From: Daniel Juyung Seo Date: Sat, 8 Mar 2014 18:39:23 +0000 (+0900) Subject: focus: Added focus highlight clip disable feature. X-Git-Tag: upstream/1.9.0+85+g1458428~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7017b3796c2c08409896d730a84d84e0f7d5dd25;p=platform%2Fupstream%2Felementary.git focus: Added focus highlight clip disable feature. focus highlight is clipped by the clipper of focus target object. But many of the times, this clipping looks weird so I made this configurable. This fixes T1056 but as this fix was done by adding a new feature, this patch would not be backported. @feature --- diff --git a/config/default/base.src b/config/default/base.src index edce1e6..1ec7bfa 100644 --- a/config/default/base.src +++ b/config/default/base.src @@ -44,6 +44,7 @@ group "Elm_Config" struct { value "cursor_engine_only" uchar: 1; value "focus_highlight_enable" uchar: 0; value "focus_highlight_animate" uchar: 0; + value "focus_highlight_clip_disable" uchar: 0; value "toolbar_shrink_mode" int: 3; value "fileselector_expand_enable" uchar: 0; value "inwin_dialogs_enable" uchar: 1; diff --git a/config/mobile/base.src b/config/mobile/base.src index f634b1d..64d6920 100644 --- a/config/mobile/base.src +++ b/config/mobile/base.src @@ -44,6 +44,7 @@ group "Elm_Config" struct { value "cursor_engine_only" uchar: 1; value "focus_highlight_enable" uchar: 0; value "focus_highlight_animate" uchar: 0; + value "focus_highlight_clip_disable" uchar: 0; value "toolbar_shrink_mode" int: 3; value "fileselector_expand_enable" uchar: 0; value "inwin_dialogs_enable" uchar: 1; diff --git a/config/standard/base.src b/config/standard/base.src index bd7ae56..a636416 100644 --- a/config/standard/base.src +++ b/config/standard/base.src @@ -44,6 +44,7 @@ group "Elm_Config" struct { value "cursor_engine_only" uchar: 1; value "focus_highlight_enable" uchar: 0; value "focus_highlight_animate" uchar: 0; + value "focus_highlight_clip_disable" uchar: 1; value "toolbar_shrink_mode" int: 3; value "fileselector_expand_enable" uchar: 1; value "fileselector_double_tap_navigation_enable" uchar: 1; diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index 843ea38..e906aac 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -503,6 +503,7 @@ _desc_init(void) ELM_CONFIG_VAL(D, T, cursor_engine_only, T_UCHAR); ELM_CONFIG_VAL(D, T, focus_highlight_enable, T_UCHAR); ELM_CONFIG_VAL(D, T, focus_highlight_animate, T_UCHAR); + ELM_CONFIG_VAL(D, T, focus_highlight_clip_disable, T_UCHAR); ELM_CONFIG_VAL(D, T, toolbar_shrink_mode, T_INT); ELM_CONFIG_VAL(D, T, fileselector_expand_enable, T_UCHAR); ELM_CONFIG_VAL(D, T, fileselector_double_tap_navigation_enable, T_UCHAR); @@ -1501,6 +1502,7 @@ _config_load(void) _elm_config->cursor_engine_only = EINA_TRUE; _elm_config->focus_highlight_enable = EINA_FALSE; _elm_config->focus_highlight_animate = EINA_TRUE; + _elm_config->focus_highlight_clip_disable = EINA_FALSE; _elm_config->toolbar_shrink_mode = 2; _elm_config->fileselector_expand_enable = EINA_FALSE; _elm_config->fileselector_double_tap_navigation_enable = EINA_FALSE; @@ -2054,6 +2056,9 @@ _env_get(void) s = getenv("ELM_FOCUS_HIGHLIGHT_ANIMATE"); if (s) _elm_config->focus_highlight_animate = !!atoi(s); + s = getenv("ELM_FOCUS_HIGHLIGHT_CLIP_DISABLE"); + if (s) _elm_config->focus_highlight_clip_disable = !!atoi(s); + s = getenv("ELM_TOOLBAR_SHRINK_MODE"); if (s) _elm_config->toolbar_shrink_mode = atoi(s); @@ -2565,6 +2570,19 @@ elm_config_focus_highlight_animate_set(Eina_Bool animate) } EAPI Eina_Bool +elm_config_focus_highlight_clip_disabled_get(void) +{ + return _elm_config->focus_highlight_clip_disable; +} + +EAPI void +elm_config_focus_highlight_clip_disabled_set(Eina_Bool disable) +{ + _elm_config->focus_highlight_clip_disable = !!disable; +} + + +EAPI Eina_Bool elm_config_scroll_bounce_enabled_get(void) { return _elm_config->thumbscroll_bounce_enable; diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h index ccbf787..1e33c47 100644 --- a/src/lib/elm_config.h +++ b/src/lib/elm_config.h @@ -1207,6 +1207,33 @@ EAPI Eina_Bool elm_config_focus_highlight_animate_get(void); EAPI void elm_config_focus_highlight_animate_set(Eina_Bool animate); /** + * Get the disable status of the focus highlight clip feature. + * + * @return The focus highlight clip disable status + * + * Get whether the focus highlight clip feature is disabled. If disabled return + * @c EINA_TRUE, else return @c EINA_FALSE. If the return is @c EINA_TRUE, focus + * highlight clip feature is not disabled so the focus highlight can be clipped. + * + * @see elm_config_focus_highlight_clip_disabled_set() + * @since 1.10 + * @ingroup Focus + */ +EAPI Eina_Bool elm_config_focus_highlight_clip_disabled_get(void); + +/** + * Set the disable status of the focus highlight clip feature. + * + * @param disable Disable focus highlight clip feature if @c EINA_TRUE, enable + * it otherwise. + * + * @see elm_config_focus_highlight_clip_disabled_get() + * @since 1.10 + * @ingroup Focus + */ +EAPI void elm_config_focus_highlight_clip_disabled_set(Eina_Bool disable); + +/** * Get the system mirrored mode. This determines the default mirrored mode * of widgets. * diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index 12d2200..534b055 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -222,6 +222,7 @@ struct _Elm_Config unsigned char cursor_engine_only; unsigned char focus_highlight_enable; unsigned char focus_highlight_animate; + unsigned char focus_highlight_clip_disable; /**< This shows disabled status of focus highlight clip feature. This value is false by default so the focus highlight is clipped. */ int toolbar_shrink_mode; unsigned char fileselector_expand_enable; unsigned char fileselector_double_tap_navigation_enable; diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 343282d..d4ed38b 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -715,7 +715,9 @@ _elm_win_focus_highlight_anim_setup(Elm_Win_Smart_Data *sd, elm_widget_focus_highlight_geometry_get(previous, &px, &py, &pw, &ph, EINA_FALSE); evas_object_move(obj, tx, ty); evas_object_resize(obj, tw, th); - evas_object_clip_unset(obj); + + if (!_elm_config->focus_highlight_clip_disable) + evas_object_clip_unset(obj); m = alloca(sizeof(*m) + (sizeof(int) * 8)); m->count = 8; @@ -737,12 +739,16 @@ _elm_win_focus_highlight_simple_setup(Elm_Win_Smart_Data *sd, Evas_Object *clip, *target = sd->focus_highlight.cur.target; Evas_Coord x, y, w, h; - clip = evas_object_clip_get(target); elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h, EINA_TRUE); evas_object_move(obj, x, y); evas_object_resize(obj, w, h); - if (clip) evas_object_clip_set(obj, clip); + + if (!_elm_config->focus_highlight_clip_disable) + { + clip = evas_object_clip_get(target); + if (clip) evas_object_clip_set(obj, clip); + } } static void