forked from enlightenment/efl
win: Merge focus_highlight_style with widget (EO)
Note: elm_test "Focus Style" can be used to test this API. The test case is a bit broken (overly complex EDC?) but if you're patient you can see the difference between "glow" and "glow_effect". Ref T5363 Ref T5322
This commit is contained in:
parent
c0d7ea4af0
commit
0972c49438
|
@ -8,7 +8,8 @@ glow_effect_on_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|||
{
|
||||
Evas_Object *chk = evas_object_data_get(obj, "glow_is_enable");
|
||||
|
||||
if (elm_check_state_get(chk)) elm_win_focus_highlight_style_set(data, "glow_effect");
|
||||
if (elm_check_state_get(chk))
|
||||
elm_win_focus_highlight_style_set(data, "glow_effect");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -16,7 +17,8 @@ glow_effect_off_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|||
{
|
||||
Evas_Object *chk = evas_object_data_get(obj, "glow_is_enable");
|
||||
|
||||
if (elm_check_state_get(chk)) elm_win_focus_highlight_style_set(data, "glow");
|
||||
if (elm_check_state_get(chk))
|
||||
elm_win_focus_highlight_style_set(data, "glow");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -6344,16 +6344,19 @@ _efl_ui_win_elm_widget_theme_apply(Eo *obj, Efl_Ui_Win_Data *sd)
|
|||
return int_ret;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_win_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *style)
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_win_elm_widget_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *style)
|
||||
{
|
||||
eina_stringshare_replace(&sd->focus_highlight.style, style);
|
||||
if (!eina_stringshare_replace(&sd->focus_highlight.style, style))
|
||||
return EINA_TRUE;
|
||||
|
||||
sd->focus_highlight.theme_changed = EINA_TRUE;
|
||||
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static const char*
|
||||
_efl_ui_win_focus_highlight_style_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
||||
_efl_ui_win_elm_widget_focus_highlight_style_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
||||
{
|
||||
return sd->focus_highlight.style;
|
||||
}
|
||||
|
@ -8163,6 +8166,19 @@ elm_win_focus_get(const Efl_Ui_Win *obj)
|
|||
return elm_obj_widget_focus_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_win_focus_highlight_style_set(Elm_Win *obj, const char *style)
|
||||
{
|
||||
elm_widget_focus_highlight_style_set(obj, style);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
elm_win_focus_highlight_style_get(const Elm_Win *obj)
|
||||
{
|
||||
return elm_widget_focus_highlight_style_get(obj);
|
||||
}
|
||||
|
||||
|
||||
// deprecated
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -268,22 +268,6 @@ 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_style {
|
||||
set {
|
||||
[[Set the style for the focus highlight on this window.
|
||||
|
||||
Sets the style to use for theming the highlight of focused
|
||||
objects on the given window. If $style is NULL, the default
|
||||
will be used.
|
||||
]]
|
||||
}
|
||||
get {
|
||||
[[Get the style set for the focus highlight object.]]
|
||||
}
|
||||
values {
|
||||
style: string @nullable; [[The style or $null if none.]]
|
||||
}
|
||||
}
|
||||
@property focus_highlight_enabled {
|
||||
set {
|
||||
[[Set the enabled status for the focus highlight in a window.
|
||||
|
@ -900,6 +884,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
|
|||
Elm.Widget.focus_next;
|
||||
Elm.Widget.theme_apply;
|
||||
Elm.Widget.focus { get; }
|
||||
Elm.Widget.focus_highlight_style { get; set; }
|
||||
Elm.Widget.on_focus_update;
|
||||
Elm.Widget.widget_event;
|
||||
Elm.Widget.focus_manager_factory;
|
||||
|
|
|
@ -517,14 +517,17 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
|
|||
}
|
||||
}
|
||||
@property focus_highlight_style {
|
||||
[[Control the widget focus highlight style.]]
|
||||
[[Control the widget focus highlight style.
|
||||
|
||||
If $style is $null, the default will be used.
|
||||
]]
|
||||
set {
|
||||
return: bool; [[$true on success, $false otherwise.]]
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
style: string; [[The name of the focus highlight style.]]
|
||||
style: string @nullable; [[The name of the focus highlight style.]]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1147,7 +1147,7 @@ EAPI Evas_Object *elm_win_get(Evas_Object *obj);
|
|||
*
|
||||
* @ingroup Efl_Ui_Win
|
||||
*/
|
||||
EAPI Eina_Bool elm_win_socket_listen(Efl_Ui_Win *obj, const char *svcname, int svcnum, Eina_Bool svcsys);
|
||||
EAPI Eina_Bool elm_win_socket_listen(Elm_Win *obj, const char *svcname, int svcnum, Eina_Bool svcsys);
|
||||
|
||||
/**
|
||||
* @brief Get whether a window has focus.
|
||||
|
@ -1156,4 +1156,25 @@ EAPI Eina_Bool elm_win_socket_listen(Efl_Ui_Win *obj, const char *svcname, int s
|
|||
*
|
||||
* @ingroup Efl_Ui_Win
|
||||
*/
|
||||
EAPI Eina_Bool elm_win_focus_get(const Efl_Ui_Win *obj);
|
||||
EAPI Eina_Bool elm_win_focus_get(const Elm_Win *obj);
|
||||
|
||||
/**
|
||||
* @brief Set the style for the focus highlight on this window.
|
||||
*
|
||||
* Sets the style to use for theming the highlight of focused objects on the
|
||||
* given window. If @c style is NULL, the default will be used.
|
||||
*
|
||||
* @param[in] style The style or @c null if none.
|
||||
*
|
||||
* @ingroup Efl_Ui_Win
|
||||
*/
|
||||
EAPI void elm_win_focus_highlight_style_set(Elm_Win *obj, const char *style);
|
||||
|
||||
/**
|
||||
* @brief Get the style set for the focus highlight object.
|
||||
*
|
||||
* @return The style or @c null if none.
|
||||
*
|
||||
* @ingroup Efl_Ui_Win
|
||||
*/
|
||||
EAPI const char *elm_win_focus_highlight_style_get(const Elm_Win *obj);
|
||||
|
|
Loading…
Reference in New Issue