summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-31 15:57:53 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-01 10:09:37 +0900
commit94632f8a44f5128ef6556aee7e0b3ff3fc2466af (patch)
tree055464e53e26f303ab2073a9d5a7584f319e4b7d
parent0972c49438f4a8b39c2e38146642e69442afa471 (diff)
downloadefl-94632f8a44f5128ef6556aee7e0b3ff3fc2466af.tar.gz
win: Move focus_highlight_enabled to widget (EO)
This was actually declared in the internal legacy API in widget. Forwards the calls to the window. Ref T
-rw-r--r--src/lib/elementary/efl_ui_win.c17
-rw-r--r--src/lib/elementary/efl_ui_win.eo18
-rw-r--r--src/lib/elementary/elm_widget.c16
-rw-r--r--src/lib/elementary/elm_widget.eo15
-rw-r--r--src/lib/elementary/elm_win_legacy.h21
5 files changed, 67 insertions, 20 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index a19456bb31..ddd7d61dff 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -6279,8 +6279,9 @@ _efl_ui_win_keygrab_unset(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *
}
EOLIAN static void
-_efl_ui_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
+_efl_ui_win_elm_widget_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
{
+ // Do not call efl_super() here. Only Win handles this property.
enabled = !!enabled;
if (sd->focus_highlight.enabled == enabled)
return;
@@ -6294,8 +6295,9 @@ _efl_ui_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd
}
EOLIAN static Eina_Bool
-_efl_ui_win_focus_highlight_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_elm_widget_focus_highlight_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
+ // Do not call efl_super() here. Only Win handles this property.
return sd->focus_highlight.enabled;
}
@@ -8178,6 +8180,17 @@ elm_win_focus_highlight_style_get(const Elm_Win *obj)
return elm_widget_focus_highlight_style_get(obj);
}
+EAPI Eina_Bool
+elm_win_focus_highlight_enabled_get(const Efl_Ui_Win *obj)
+{
+ return elm_widget_focus_highlight_enabled_get(obj);
+}
+
+EAPI void
+elm_win_focus_highlight_enabled_set(Efl_Ui_Win *obj, Eina_Bool enabled)
+{
+ elm_obj_widget_focus_highlight_enabled_set(obj, enabled);
+}
// deprecated
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index 83e095dff7..80253a5ca1 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -268,27 +268,12 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
constrain: bool; [[$true to restrict the window's maximum size.]]
}
}
- @property focus_highlight_enabled {
- set {
- [[Set the enabled status for the focus highlight in a window.
-
- This function will enable or disable the focus highlight only
- for the given window, regardless of the global setting for it.
- ]]
- }
- get {
- [[Get the enabled value of the focus highlight for this window.]]
- }
- values {
- enabled: bool; [[The enabled value for the highlight.]]
- }
- }
@property focus_highlight_animate {
set {
[[Set the animate status for the focus highlight for this window.
This function will enable or disable the animation of focus
- highlight only for the given window, regardless of the
+ highlight only for the given window, rof the
global setting for it.
]]
}
@@ -885,6 +870,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
Elm.Widget.theme_apply;
Elm.Widget.focus { get; }
Elm.Widget.focus_highlight_style { get; set; }
+ Elm.Widget.focus_highlight_enabled { get; set; }
Elm.Widget.on_focus_update;
Elm.Widget.widget_event;
Elm.Widget.focus_manager_factory;
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 9e69af9b8c..228abfbd9d 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -190,16 +190,28 @@ _elm_widget_focus_highlight_object_get(const Evas_Object *obj)
return NULL;
}
-EAPI Eina_Bool
-elm_widget_focus_highlight_enabled_get(const Evas_Object *obj)
+EOLIAN static Eina_Bool
+_elm_widget_focus_highlight_enabled_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
{
+ // Forward to closest parent Window
const Evas_Object *win = elm_widget_top_get(obj);
if (win && efl_isa(win, EFL_UI_WIN_CLASS))
return elm_win_focus_highlight_enabled_get(win);
+
return EINA_FALSE;
}
+EOLIAN static void
+_elm_widget_focus_highlight_enabled_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Bool enable)
+{
+ // Forward to closest parent Window
+ Evas_Object *win = elm_widget_top_get(obj);
+
+ if (win && efl_isa(win, EFL_UI_WIN_CLASS))
+ elm_win_focus_highlight_enabled_set(win, enable);
+}
+
static Eina_Bool
_tree_unfocusable(Eo *obj)
{
diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo
index b354c7cb16..60181466f4 100644
--- a/src/lib/elementary/elm_widget.eo
+++ b/src/lib/elementary/elm_widget.eo
@@ -530,6 +530,21 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
style: string @nullable; [[The name of the focus highlight style.]]
}
}
+ @property focus_highlight_enabled {
+ set {
+ [[Set the enabled status for the focus highlight in a window.
+
+ This function will enable or disable the focus highlight only
+ for the given window, regardless of the global setting for it.
+ ]]
+ }
+ get {
+ [[Get the enabled value of the focus highlight for this window.]]
+ }
+ values {
+ enabled: bool; [[The enabled value for the highlight.]]
+ }
+ }
/* Old focus API. FIXME: Needs massive clean up! */
@property focus_order @beta {
diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h
index 7f0e34c017..48b0590a7c 100644
--- a/src/lib/elementary/elm_win_legacy.h
+++ b/src/lib/elementary/elm_win_legacy.h
@@ -1178,3 +1178,24 @@ EAPI void elm_win_focus_highlight_style_set(Elm_Win *obj, const char *style);
* @ingroup Efl_Ui_Win
*/
EAPI const char *elm_win_focus_highlight_style_get(const Elm_Win *obj);
+
+/**
+ * @brief Set the enabled status for the focus highlight in a window.
+ *
+ * This function will enable or disable the focus highlight only for the given
+ * window, regardless of the global setting for it.
+ *
+ * @param[in] enabled The enabled value for the highlight.
+ *
+ * @ingroup Efl_Ui_Win
+ */
+EAPI void elm_win_focus_highlight_enabled_set(Elm_Win *obj, Eina_Bool enabled);
+
+/**
+ * @brief Get the enabled value of the focus highlight for this window.
+ *
+ * @return The enabled value for the highlight.
+ *
+ * @ingroup Efl_Ui_Win
+ */
+EAPI Eina_Bool elm_win_focus_highlight_enabled_get(const Elm_Win *obj);