forked from enlightenment/efl
Focus highlight kinda configurable. More to come when discomfitor feels like implementing it
SVN revision: 53031
This commit is contained in:
parent
92c9171d37
commit
e8ef45befb
|
@ -22,4 +22,6 @@ group "Elm_Config" struct {
|
|||
value "modules" string: "";
|
||||
value "tooltip_delay" double: 1.0;
|
||||
value "cursor_engine_only" int: 1;
|
||||
value "focus_highlight_enable" int: 0;
|
||||
value "focus_highlight_animate" int: 0;
|
||||
}
|
||||
|
|
|
@ -22,4 +22,6 @@ group "Elm_Config" struct {
|
|||
value "modules" string: "";
|
||||
value "tooltip_delay" double: 1.0;
|
||||
value "cursor_engine_only" int: 1;
|
||||
value "focus_highlight_enable" int: 0;
|
||||
value "focus_highlight_animate" int: 0;
|
||||
}
|
||||
|
|
|
@ -22,4 +22,6 @@ group "Elm_Config" struct {
|
|||
value "modules" string: "";
|
||||
value "tooltip_delay" double: 1.0;
|
||||
value "cursor_engine_only" int: 1;
|
||||
value "focus_highlight_enable" int: 0;
|
||||
value "focus_highlight_animate" int: 0;
|
||||
}
|
||||
|
|
|
@ -312,6 +312,11 @@ extern "C" {
|
|||
EAPI void elm_finger_size_set(Evas_Coord size);
|
||||
EAPI void elm_finger_size_all_set(Evas_Coord size);
|
||||
|
||||
EAPI Eina_Bool elm_focus_highlight_enable_get(void);
|
||||
EAPI void elm_focus_highlight_enable_set(Eina_Bool enable);
|
||||
EAPI Eina_Bool elm_focus_highlight_animate_get(void);
|
||||
EAPI void elm_focus_highlight_animate_set(Eina_Bool animate);
|
||||
|
||||
EAPI Eina_Bool elm_object_focus_get(Evas_Object *obj);
|
||||
EAPI void elm_object_focus(Evas_Object *obj);
|
||||
EAPI void elm_object_unfocus(Evas_Object *obj);
|
||||
|
|
|
@ -226,6 +226,8 @@ _desc_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "modules", modules, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "tooltip_delay", tooltip_delay, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "cursor_engine_only", cursor_engine_only, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "focus_highlight_enable", focus_highlight_enable, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "focus_highlight_animate", focus_highlight_animate, EET_T_INT);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -413,6 +415,8 @@ _config_load(void)
|
|||
_elm_config->modules = NULL;
|
||||
_elm_config->tooltip_delay = 1.0;
|
||||
_elm_config->cursor_engine_only = 1;
|
||||
_elm_config->focus_highlight_enable = 0;
|
||||
_elm_config->focus_highlight_animate = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -613,6 +617,12 @@ _env_get(void)
|
|||
|
||||
s = getenv("ELM_CURSOR_ENGINE_ONLY");
|
||||
if (s) _elm_config->cursor_engine_only = atoi(s);
|
||||
|
||||
s = getenv("ELM_FOCUS_HIGHLIGHT_ENABLE");
|
||||
if (s) _elm_config->focus_highlight_enable = atoi(s);
|
||||
|
||||
s = getenv("ELM_FOCUS_HIGHLIGHT_ANIMATE");
|
||||
if (s) _elm_config->focus_highlight_animate = atoi(s);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1169,6 +1169,58 @@ elm_finger_size_all_set(Evas_Coord size)
|
|||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enable status of the focus highlight
|
||||
*
|
||||
* This gets whether the highlight on focused objects is enabled or not
|
||||
* @ingroup Config
|
||||
*/
|
||||
EAPI Eina_Bool
|
||||
elm_focus_highlight_enable_get(void)
|
||||
{
|
||||
return _elm_config->focus_highlight_enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the enable status of the focus highlight
|
||||
*
|
||||
* Set whether to show or not the highlight on focused objects
|
||||
* @param enable Enable highlight if EINA_TRUE, disable otherwise
|
||||
* @ingroup Config
|
||||
*/
|
||||
EAPI void
|
||||
elm_focus_highlight_enable_set(Eina_Bool enable)
|
||||
{
|
||||
_elm_config->focus_highlight_enable = !!enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enable status of the highlight animation
|
||||
*
|
||||
* Get whether the focus highlight, if enabled, will animate its switch from
|
||||
* one object to the next
|
||||
* @ingroup Config
|
||||
*/
|
||||
EAPI Eina_Bool
|
||||
elm_focus_highlight_animate_get(void)
|
||||
{
|
||||
return _elm_config->focus_highlight_animate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the enable status of the highlight animation
|
||||
*
|
||||
* Set whether the focus highlight, if enabled, will animate its switch from
|
||||
* one object to the next
|
||||
* @param animate Enable animation if EINA_TRUE, disable otherwise
|
||||
* @ingroup Config
|
||||
*/
|
||||
EAPI void
|
||||
elm_focus_highlight_animate_set(Eina_Bool animate)
|
||||
{
|
||||
_elm_config->focus_highlight_animate = !!animate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust size of an element for finger usage
|
||||
*
|
||||
|
|
|
@ -93,6 +93,8 @@ struct _Elm_Config
|
|||
const char *modules;
|
||||
double tooltip_delay;
|
||||
int cursor_engine_only;
|
||||
int focus_highlight_enable;
|
||||
int focus_highlight_animate;
|
||||
};
|
||||
|
||||
struct _Elm_Module
|
||||
|
|
|
@ -809,8 +809,11 @@ _elm_win_focus_highlight_reconfigure(Elm_Win *win)
|
|||
"default"); /* FIXME: use style */
|
||||
win->focus_highlight.changed_theme = EINA_FALSE;
|
||||
|
||||
str = edje_object_data_get(win->focus_highlight.top, "animate");
|
||||
win->focus_highlight.top_animate = (str && !strcmp(str, "on"));
|
||||
if (_elm_config->focus_highlight_animate)
|
||||
{
|
||||
str = edje_object_data_get(win->focus_highlight.top, "animate");
|
||||
win->focus_highlight.top_animate = (str && !strcmp(str, "on"));
|
||||
}
|
||||
}
|
||||
|
||||
if (win->focus_highlight.top_animate && previous &&
|
||||
|
@ -1035,6 +1038,9 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
|||
break;
|
||||
}
|
||||
|
||||
if (_elm_config->focus_highlight_enable)
|
||||
elm_win_focus_highlight_enabled_set(win->win_obj, EINA_TRUE);
|
||||
|
||||
return win->win_obj;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue