aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/elm_widget.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2017-10-17 15:17:50 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2017-10-17 17:31:23 +0200
commitaa4c3c9eb783338781ca43fc1f386a38f1ca774c (patch)
treec58b0d2caff1daede9468c35eb13376c4d307620 /src/lib/elementary/elm_widget.c
parentelementary: remove documentation error (diff)
downloadefl-aa4c3c9eb783338781ca43fc1f386a38f1ca774c.tar.gz
elm_widget: move evaluation for registeration of widget
this is now earlier done, so we can reacted based on that
Diffstat (limited to 'src/lib/elementary/elm_widget.c')
-rw-r--r--src/lib/elementary/elm_widget.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 24c52851c1..08c3045713 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -377,50 +377,52 @@ _elm_widget_focus_state_apply(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED, El
);
return EINA_FALSE;
}
-
static void
-_focus_state_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
+_eval_registration_candidate(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool *should, Eina_Bool *want_full)
{
- Eina_Bool should = EINA_FALSE;
- Eina_Bool want_full = EINA_FALSE;
- Elm_Widget_Focus_State configuration;
-
- //this would mean we are registering again the root, we dont want that
- if (pd->manager.manager == obj) return;
-
- //there are two reasons to be registered, the child count is bigger than 0, or the widget is flagged to be able to handle focus
- if (pd->can_focus)
- {
- should = EINA_TRUE;
+ *should = *want_full = EINA_FALSE;
+ if (pd->can_focus)
+ {
+ *should = EINA_TRUE;
//can focus can be overridden by the following properties
if (_tree_unfocusable(obj))
- should = EINA_FALSE;
+ *should = EINA_FALSE;
if (_tree_disabled(obj))
- should = EINA_FALSE;
+ *should = EINA_FALSE;
if (!evas_object_visible_get(obj))
- should = EINA_FALSE;
+ *should = EINA_FALSE;
- if (should)
- want_full = EINA_TRUE;
+ if (*should)
+ *want_full = EINA_TRUE;
}
- if (!should && pd->logical.child_count > 0)
+ if (!*should && pd->logical.child_count > 0)
{
- should = EINA_TRUE;
+ *should = EINA_TRUE;
if (_tree_unfocusable(obj))
- should = EINA_FALSE;
+ *should = EINA_FALSE;
if (_tree_disabled(obj))
- should = EINA_FALSE;
+ *should = EINA_FALSE;
if (!evas_object_visible_get(obj))
- should = EINA_FALSE;
+ *should = EINA_FALSE;
}
+}
+static void
+_focus_state_eval(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool should, Eina_Bool want_full)
+{
+ Elm_Widget_Focus_State configuration;
+
+ //this would mean we are registering again the root, we dont want that
+ if (pd->manager.manager == obj) return;
+
+ //there are two reasons to be registered, the child count is bigger than 0, or the widget is flagged to be able to handle focus
if (should)
{
configuration.parent = pd->logical.parent;
@@ -506,6 +508,9 @@ _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
{
Efl_Ui_Focus_Object *old_parent;
Efl_Ui_Focus_Object *old_registered_parent, *old_registered_manager;
+ Eina_Bool should, want_full;
+
+ _eval_registration_candidate(obj, pd, &should, &want_full);
old_parent = _logical_parent_eval(obj, pd);
@@ -527,7 +532,7 @@ _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
old_registered_parent = pd->focus.parent;
old_registered_manager = pd->focus.manager;
- _focus_state_eval(obj, pd);
+ _focus_state_eval(obj, pd, should, want_full);
if (old_registered_parent != pd->focus.parent)
{