From b077058e44f3bec0c1f08ec74a0d6668ac2c952e Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 25 Apr 2017 17:04:50 +0200 Subject: [PATCH] elm_box/table: set the order directly when a container is registered The following situation: - A Box in a naviframe, with n children. - All added children register to the focus graph with the box as parent, order gets set correctly. - Naviframe hides this item, so box property tree unfocusable gets set to true, it gets unregistered from the focus graph, even every single child gets unregistered. - The item gets shown - every child and the table are getting registered again. - Order is not set again, since the box does not get changed - Order of the children is mixed up. This should fix this case since the order is flushed every time the box gets registered. --- src/lib/elementary/elm_box.c | 10 ++++++++++ src/lib/elementary/elm_box.eo | 1 + src/lib/elementary/elm_table.c | 12 ++++++++++++ src/lib/elementary/elm_table.eo | 1 + 4 files changed, 24 insertions(+) diff --git a/src/lib/elementary/elm_box.c b/src/lib/elementary/elm_box.c index 580b707..f41815b 100644 --- a/src/lib/elementary/elm_box.c +++ b/src/lib/elementary/elm_box.c @@ -715,5 +715,15 @@ _elm_box_class_constructor(Efl_Class *klass) { evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } +EOLIAN Eina_Bool +_elm_box_elm_widget_focus_register(Eo *obj, Elm_Box_Data *pd, Efl_Ui_Focus_Manager *manager, Efl_Ui_Focus_Object *logical, Eina_Bool full) +{ + Eina_Bool result = elm_obj_widget_focus_register(efl_super(obj, MY_CLASS), manager, logical, full); + + //later registering children are automatically set into the order of the internal table + _focus_order_flush(obj, pd); + + return result; +} #include "elm_box.eo.c" diff --git a/src/lib/elementary/elm_box.eo b/src/lib/elementary/elm_box.eo index 61eda1b..da0d399 100644 --- a/src/lib/elementary/elm_box.eo +++ b/src/lib/elementary/elm_box.eo @@ -295,6 +295,7 @@ class Elm.Box (Elm.Widget) Elm.Widget.focus_next; Elm.Widget.theme_apply; Elm.Widget.sub_object_del; + Elm.Widget.focus_register; } events { child,added; [[Called when child was added]] diff --git a/src/lib/elementary/elm_table.c b/src/lib/elementary/elm_table.c index cd57be3..c4ddacd 100644 --- a/src/lib/elementary/elm_table.c +++ b/src/lib/elementary/elm_table.c @@ -417,4 +417,16 @@ _elm_table_efl_canvas_group_group_calculate(Eo *obj, void *pd EINA_UNUSED) evas_object_smart_calculate(wd->resize_obj); } +EOLIAN Eina_Bool +_elm_table_elm_widget_focus_register(Eo *obj, void *pd EINA_UNUSED, Efl_Ui_Focus_Manager *manager, Efl_Ui_Focus_Object *logical, Eina_Bool full) +{ + Eina_Bool result = elm_obj_widget_focus_register(efl_super(obj, MY_CLASS), manager, logical, full); + + //later registering children are automatically set into the order of the internal table + _focus_order_flush(obj); + + return result; +} + + #include "elm_table.eo.c" diff --git a/src/lib/elementary/elm_table.eo b/src/lib/elementary/elm_table.eo index 92c8deb..fa3cd92 100644 --- a/src/lib/elementary/elm_table.eo +++ b/src/lib/elementary/elm_table.eo @@ -129,5 +129,6 @@ class Elm.Table (Elm.Widget) Elm.Widget.focus_direction_manager_is; Elm.Widget.theme_apply; Elm.Widget.sub_object_del; + Elm.Widget.focus_register; } } -- 2.7.4