bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c972347c1c513618ce62900be7a205763c107d91

commit c972347c1c513618ce62900be7a205763c107d91
Author: Marcel Hollerbach <[email protected]>
Date:   Mon Sep 24 11:02:09 2018 +0200

    efl_ui_focus: add flag to indicate if a child has the focus
    
    this is usefull for later implementations in spinner and fileselector.
    A event for this was not added because the result is only really usefull
    after a focus operation has been successfull.
    
    Differential Revision: https://phab.enlightenment.org/D7102
---
 src/lib/elementary/efl_ui_focus_object.c  | 17 +++++++++++++++++
 src/lib/elementary/efl_ui_focus_object.eo |  6 ++++++
 2 files changed, 23 insertions(+)

diff --git a/src/lib/elementary/efl_ui_focus_object.c 
b/src/lib/elementary/efl_ui_focus_object.c
index 946d605ccf..89e7af2a5d 100644
--- a/src/lib/elementary/efl_ui_focus_object.c
+++ b/src/lib/elementary/efl_ui_focus_object.c
@@ -10,6 +10,7 @@
 typedef struct {
   Eina_Bool old_focus;
   Eina_Bool ongoing_prepare_call;
+  Eina_Bool child_focus;
 } Efl_Ui_Focus_Object_Data;
 
 EOLIAN static void
@@ -18,6 +19,7 @@ _efl_ui_focus_object_focus_set(Eo *obj, 
Efl_Ui_Focus_Object_Data *pd, Eina_Bool
    if (pd->old_focus == focus) return;
 
    pd->old_focus = focus;
+   
efl_ui_focus_object_child_focus_set(efl_ui_focus_object_focus_parent_get(obj), 
focus);
    efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , 
(void*) (uintptr_t) focus);
 }
 
@@ -39,6 +41,21 @@ _efl_ui_focus_object_prepare_logical(Eo *obj, 
Efl_Ui_Focus_Object_Data *pd)
   pd->ongoing_prepare_call = EINA_FALSE;
 }
 
+EOLIAN static void
+_efl_ui_focus_object_child_focus_set(Eo *obj, Efl_Ui_Focus_Object_Data *pd, 
Eina_Bool child_focus)
+{
+   if (child_focus == pd->child_focus) return;
+
+   pd->child_focus = child_focus;
+   
efl_ui_focus_object_child_focus_set(efl_ui_focus_object_focus_parent_get(obj), 
pd->child_focus);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_focus_object_child_focus_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Focus_Object_Data *pd)
+{
+   return pd->child_focus;
+}
+
 
 
 #include "efl_ui_focus_object.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_object.eo 
b/src/lib/elementary/efl_ui_focus_object.eo
index 77be807ff7..dd22339965 100644
--- a/src/lib/elementary/efl_ui_focus_object.eo
+++ b/src/lib/elementary/efl_ui_focus_object.eo
@@ -54,6 +54,12 @@ mixin Efl.Ui.Focus.Object
                 logical_parent : Efl.Ui.Focus.Object; [[The focus parent.]]
             }
         }
+        @property child_focus @protected {
+            [[set if a child of this element has focus or not.]]
+            values {
+               child_focus : bool;
+            }
+        }
         prepare_logical {
             [[Tells the object that its children will be queried soon by the 
given manager.
               The call will be a NOP if there is already a active 
preprare_logical call on this object

-- 


Reply via email to