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.
This commit is contained in:
Marcel Hollerbach 2017-04-25 17:04:50 +02:00
parent 69877a91af
commit b077058e44
4 changed files with 24 additions and 0 deletions

View File

@ -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"

View File

@ -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]]

View File

@ -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"

View File

@ -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;
}
}