diff options
author | Daniel Hirt <daniel.hirt@samsung.com> | 2016-03-09 15:47:03 +0200 |
---|---|---|
committer | Daniel Hirt <daniel.hirt@samsung.com> | 2016-03-15 11:33:19 +0200 |
commit | c36132c5678a36efc30046e3614549160861c158 (patch) | |
tree | 990b337532790b3d5a9594bec739427a71998d92 | |
parent | 256daa8eff91e0acfe5fb2e81a4f81e7bd51266c (diff) | |
download | elementary-c36132c5678a36efc30046e3614549160861c158.tar.gz |
Entry: Move theming size evaluation to eo_base_finalize
Entry inherits from layout, and we have sizing_eval() calls both entry
and the layout parent object, due to super calls in smart_add.
This is not only redundant but actually wrong.
On a side node, Super calls should be handled with care, and maybe in
the future we should remove them all from the smart_add functions and
do it properly.
Also, Label is going to inherit from Entry, so we need to skip the
theming of the object (and especially not do it in the super'd
smart_add).
To be continued with commits the follows for merging Label to Entry.
-rw-r--r-- | src/lib/elm_entry.c | 17 | ||||
-rw-r--r-- | src/lib/elm_entry.eo | 1 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 75042abb6..c8cfb9314 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -3566,9 +3566,6 @@ _elm_entry_evas_object_smart_add(Eo *obj, Elm_Entry_Data *priv) NULL, NULL, _drag_drop_cb, NULL); - if (!elm_layout_theme_set(obj, "entry", "base", elm_widget_style_get(obj))) - CRI("Failed to set layout!"); - priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_data_set(priv->hit_rect, "_elm_leaveme", obj); @@ -3663,8 +3660,6 @@ _elm_entry_evas_object_smart_add(Eo *obj, Elm_Entry_Data *priv) (priv->entry_edje, "entry,redo,request", "elm.text", _entry_redo_request_signal_cb, obj); - elm_layout_text_set(obj, "elm.text", ""); - elm_object_sub_cursor_set (wd->resize_obj, obj, ELM_CURSOR_XTERM); elm_widget_can_focus_set(obj, EINA_TRUE); @@ -3672,8 +3667,6 @@ _elm_entry_evas_object_smart_add(Eo *obj, Elm_Entry_Data *priv) edje_object_part_text_select_allow_set (priv->entry_edje, "elm.text", EINA_TRUE); - elm_layout_sizing_eval(obj); - elm_entry_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL); elm_entry_input_panel_enabled_set(obj, EINA_TRUE); elm_entry_prediction_allow_set(obj, EINA_TRUE); @@ -3912,6 +3905,16 @@ _elm_entry_eo_base_constructor(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED) return obj; } +EOLIAN static Eo * +_elm_entry_eo_base_finalize(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED) +{ + if (!elm_layout_theme_set(obj, "entry", "base", elm_widget_style_get(obj))) + CRI("Failed to set layout!"); + elm_layout_text_set(obj, "elm.text", ""); + elm_layout_sizing_eval(obj); + return obj; +} + EOLIAN static void _elm_entry_text_style_user_push(Eo *obj, Elm_Entry_Data *sd, const char *style) { diff --git a/src/lib/elm_entry.eo b/src/lib/elm_entry.eo index 166c6c75b..52ced8a62 100644 --- a/src/lib/elm_entry.eo +++ b/src/lib/elm_entry.eo @@ -918,6 +918,7 @@ class Elm.Entry (Elm.Layout, Elm.Interface_Scrollable, Evas.Clickable_Interface, implements { class.constructor; Eo.Base.constructor; + Eo.Base.finalize; Evas.Object_Smart.move; Evas.Object_Smart.member_add; Evas.Object_Smart.add; |