diff options
author | Daniel Juyung Seo <seojuyung2@gmail.com> | 2014-03-09 03:39:23 +0900 |
---|---|---|
committer | Daniel Juyung Seo <seojuyung2@gmail.com> | 2014-03-09 03:39:23 +0900 |
commit | 7017b3796c2c08409896d730a84d84e0f7d5dd25 (patch) | |
tree | 2bb7937ef0ec9bee8374017673de7b90ed3b1acb | |
parent | 8b1284d3f4b9768b74a6363e10cf2dc608d0956f (diff) |
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
-rw-r--r-- | config/default/base.src | 1 | ||||
-rw-r--r-- | config/mobile/base.src | 1 | ||||
-rw-r--r-- | config/standard/base.src | 1 | ||||
-rw-r--r-- | src/lib/elm_config.c | 18 | ||||
-rw-r--r-- | src/lib/elm_config.h | 27 | ||||
-rw-r--r-- | src/lib/elm_priv.h | 1 | ||||
-rw-r--r-- | src/lib/elm_win.c | 12 |
7 files changed, 58 insertions, 3 deletions
diff --git a/config/default/base.src b/config/default/base.src index edce1e627..1ec7bfa1d 100644 --- a/config/default/base.src +++ b/config/default/base.src | |||
@@ -44,6 +44,7 @@ group "Elm_Config" struct { | |||
44 | value "cursor_engine_only" uchar: 1; | 44 | value "cursor_engine_only" uchar: 1; |
45 | value "focus_highlight_enable" uchar: 0; | 45 | value "focus_highlight_enable" uchar: 0; |
46 | value "focus_highlight_animate" uchar: 0; | 46 | value "focus_highlight_animate" uchar: 0; |
47 | value "focus_highlight_clip_disable" uchar: 0; | ||
47 | value "toolbar_shrink_mode" int: 3; | 48 | value "toolbar_shrink_mode" int: 3; |
48 | value "fileselector_expand_enable" uchar: 0; | 49 | value "fileselector_expand_enable" uchar: 0; |
49 | value "inwin_dialogs_enable" uchar: 1; | 50 | value "inwin_dialogs_enable" uchar: 1; |
diff --git a/config/mobile/base.src b/config/mobile/base.src index f634b1de8..64d6920b0 100644 --- a/config/mobile/base.src +++ b/config/mobile/base.src | |||
@@ -44,6 +44,7 @@ group "Elm_Config" struct { | |||
44 | value "cursor_engine_only" uchar: 1; | 44 | value "cursor_engine_only" uchar: 1; |
45 | value "focus_highlight_enable" uchar: 0; | 45 | value "focus_highlight_enable" uchar: 0; |
46 | value "focus_highlight_animate" uchar: 0; | 46 | value "focus_highlight_animate" uchar: 0; |
47 | value "focus_highlight_clip_disable" uchar: 0; | ||
47 | value "toolbar_shrink_mode" int: 3; | 48 | value "toolbar_shrink_mode" int: 3; |
48 | value "fileselector_expand_enable" uchar: 0; | 49 | value "fileselector_expand_enable" uchar: 0; |
49 | value "inwin_dialogs_enable" uchar: 1; | 50 | value "inwin_dialogs_enable" uchar: 1; |
diff --git a/config/standard/base.src b/config/standard/base.src index bd7ae561e..a6364167c 100644 --- a/config/standard/base.src +++ b/config/standard/base.src | |||
@@ -44,6 +44,7 @@ group "Elm_Config" struct { | |||
44 | value "cursor_engine_only" uchar: 1; | 44 | value "cursor_engine_only" uchar: 1; |
45 | value "focus_highlight_enable" uchar: 0; | 45 | value "focus_highlight_enable" uchar: 0; |
46 | value "focus_highlight_animate" uchar: 0; | 46 | value "focus_highlight_animate" uchar: 0; |
47 | value "focus_highlight_clip_disable" uchar: 1; | ||
47 | value "toolbar_shrink_mode" int: 3; | 48 | value "toolbar_shrink_mode" int: 3; |
48 | value "fileselector_expand_enable" uchar: 1; | 49 | value "fileselector_expand_enable" uchar: 1; |
49 | value "fileselector_double_tap_navigation_enable" uchar: 1; | 50 | value "fileselector_double_tap_navigation_enable" uchar: 1; |
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index 843ea38eb..e906aac08 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c | |||
@@ -503,6 +503,7 @@ _desc_init(void) | |||
503 | ELM_CONFIG_VAL(D, T, cursor_engine_only, T_UCHAR); | 503 | ELM_CONFIG_VAL(D, T, cursor_engine_only, T_UCHAR); |
504 | ELM_CONFIG_VAL(D, T, focus_highlight_enable, T_UCHAR); | 504 | ELM_CONFIG_VAL(D, T, focus_highlight_enable, T_UCHAR); |
505 | ELM_CONFIG_VAL(D, T, focus_highlight_animate, T_UCHAR); | 505 | ELM_CONFIG_VAL(D, T, focus_highlight_animate, T_UCHAR); |
506 | ELM_CONFIG_VAL(D, T, focus_highlight_clip_disable, T_UCHAR); | ||
506 | ELM_CONFIG_VAL(D, T, toolbar_shrink_mode, T_INT); | 507 | ELM_CONFIG_VAL(D, T, toolbar_shrink_mode, T_INT); |
507 | ELM_CONFIG_VAL(D, T, fileselector_expand_enable, T_UCHAR); | 508 | ELM_CONFIG_VAL(D, T, fileselector_expand_enable, T_UCHAR); |
508 | ELM_CONFIG_VAL(D, T, fileselector_double_tap_navigation_enable, T_UCHAR); | 509 | ELM_CONFIG_VAL(D, T, fileselector_double_tap_navigation_enable, T_UCHAR); |
@@ -1501,6 +1502,7 @@ _config_load(void) | |||
1501 | _elm_config->cursor_engine_only = EINA_TRUE; | 1502 | _elm_config->cursor_engine_only = EINA_TRUE; |
1502 | _elm_config->focus_highlight_enable = EINA_FALSE; | 1503 | _elm_config->focus_highlight_enable = EINA_FALSE; |
1503 | _elm_config->focus_highlight_animate = EINA_TRUE; | 1504 | _elm_config->focus_highlight_animate = EINA_TRUE; |
1505 | _elm_config->focus_highlight_clip_disable = EINA_FALSE; | ||
1504 | _elm_config->toolbar_shrink_mode = 2; | 1506 | _elm_config->toolbar_shrink_mode = 2; |
1505 | _elm_config->fileselector_expand_enable = EINA_FALSE; | 1507 | _elm_config->fileselector_expand_enable = EINA_FALSE; |
1506 | _elm_config->fileselector_double_tap_navigation_enable = EINA_FALSE; | 1508 | _elm_config->fileselector_double_tap_navigation_enable = EINA_FALSE; |
@@ -2054,6 +2056,9 @@ _env_get(void) | |||
2054 | s = getenv("ELM_FOCUS_HIGHLIGHT_ANIMATE"); | 2056 | s = getenv("ELM_FOCUS_HIGHLIGHT_ANIMATE"); |
2055 | if (s) _elm_config->focus_highlight_animate = !!atoi(s); | 2057 | if (s) _elm_config->focus_highlight_animate = !!atoi(s); |
2056 | 2058 | ||
2059 | s = getenv("ELM_FOCUS_HIGHLIGHT_CLIP_DISABLE"); | ||
2060 | if (s) _elm_config->focus_highlight_clip_disable = !!atoi(s); | ||
2061 | |||
2057 | s = getenv("ELM_TOOLBAR_SHRINK_MODE"); | 2062 | s = getenv("ELM_TOOLBAR_SHRINK_MODE"); |
2058 | if (s) _elm_config->toolbar_shrink_mode = atoi(s); | 2063 | if (s) _elm_config->toolbar_shrink_mode = atoi(s); |
2059 | 2064 | ||
@@ -2565,6 +2570,19 @@ elm_config_focus_highlight_animate_set(Eina_Bool animate) | |||
2565 | } | 2570 | } |
2566 | 2571 | ||
2567 | EAPI Eina_Bool | 2572 | EAPI Eina_Bool |
2573 | elm_config_focus_highlight_clip_disabled_get(void) | ||
2574 | { | ||
2575 | return _elm_config->focus_highlight_clip_disable; | ||
2576 | } | ||
2577 | |||
2578 | EAPI void | ||
2579 | elm_config_focus_highlight_clip_disabled_set(Eina_Bool disable) | ||
2580 | { | ||
2581 | _elm_config->focus_highlight_clip_disable = !!disable; | ||
2582 | } | ||
2583 | |||
2584 | |||
2585 | EAPI Eina_Bool | ||
2568 | elm_config_scroll_bounce_enabled_get(void) | 2586 | elm_config_scroll_bounce_enabled_get(void) |
2569 | { | 2587 | { |
2570 | return _elm_config->thumbscroll_bounce_enable; | 2588 | return _elm_config->thumbscroll_bounce_enable; |
diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h index ccbf78720..1e33c479e 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); | |||
1207 | EAPI void elm_config_focus_highlight_animate_set(Eina_Bool animate); | 1207 | EAPI void elm_config_focus_highlight_animate_set(Eina_Bool animate); |
1208 | 1208 | ||
1209 | /** | 1209 | /** |
1210 | * Get the disable status of the focus highlight clip feature. | ||
1211 | * | ||
1212 | * @return The focus highlight clip disable status | ||
1213 | * | ||
1214 | * Get whether the focus highlight clip feature is disabled. If disabled return | ||
1215 | * @c EINA_TRUE, else return @c EINA_FALSE. If the return is @c EINA_TRUE, focus | ||
1216 | * highlight clip feature is not disabled so the focus highlight can be clipped. | ||
1217 | * | ||
1218 | * @see elm_config_focus_highlight_clip_disabled_set() | ||
1219 | * @since 1.10 | ||
1220 | * @ingroup Focus | ||
1221 | */ | ||
1222 | EAPI Eina_Bool elm_config_focus_highlight_clip_disabled_get(void); | ||
1223 | |||
1224 | /** | ||
1225 | * Set the disable status of the focus highlight clip feature. | ||
1226 | * | ||
1227 | * @param disable Disable focus highlight clip feature if @c EINA_TRUE, enable | ||
1228 | * it otherwise. | ||
1229 | * | ||
1230 | * @see elm_config_focus_highlight_clip_disabled_get() | ||
1231 | * @since 1.10 | ||
1232 | * @ingroup Focus | ||
1233 | */ | ||
1234 | EAPI void elm_config_focus_highlight_clip_disabled_set(Eina_Bool disable); | ||
1235 | |||
1236 | /** | ||
1210 | * Get the system mirrored mode. This determines the default mirrored mode | 1237 | * Get the system mirrored mode. This determines the default mirrored mode |
1211 | * of widgets. | 1238 | * of widgets. |
1212 | * | 1239 | * |
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index 12d2200bc..534b05574 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h | |||
@@ -222,6 +222,7 @@ struct _Elm_Config | |||
222 | unsigned char cursor_engine_only; | 222 | unsigned char cursor_engine_only; |
223 | unsigned char focus_highlight_enable; | 223 | unsigned char focus_highlight_enable; |
224 | unsigned char focus_highlight_animate; | 224 | unsigned char focus_highlight_animate; |
225 | 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. */ | ||
225 | int toolbar_shrink_mode; | 226 | int toolbar_shrink_mode; |
226 | unsigned char fileselector_expand_enable; | 227 | unsigned char fileselector_expand_enable; |
227 | unsigned char fileselector_double_tap_navigation_enable; | 228 | unsigned char fileselector_double_tap_navigation_enable; |
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 343282db7..d4ed38bb7 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, | |||
715 | elm_widget_focus_highlight_geometry_get(previous, &px, &py, &pw, &ph, EINA_FALSE); | 715 | elm_widget_focus_highlight_geometry_get(previous, &px, &py, &pw, &ph, EINA_FALSE); |
716 | evas_object_move(obj, tx, ty); | 716 | evas_object_move(obj, tx, ty); |
717 | evas_object_resize(obj, tw, th); | 717 | evas_object_resize(obj, tw, th); |
718 | evas_object_clip_unset(obj); | 718 | |
719 | if (!_elm_config->focus_highlight_clip_disable) | ||
720 | evas_object_clip_unset(obj); | ||
719 | 721 | ||
720 | m = alloca(sizeof(*m) + (sizeof(int) * 8)); | 722 | m = alloca(sizeof(*m) + (sizeof(int) * 8)); |
721 | m->count = 8; | 723 | m->count = 8; |
@@ -737,12 +739,16 @@ _elm_win_focus_highlight_simple_setup(Elm_Win_Smart_Data *sd, | |||
737 | Evas_Object *clip, *target = sd->focus_highlight.cur.target; | 739 | Evas_Object *clip, *target = sd->focus_highlight.cur.target; |
738 | Evas_Coord x, y, w, h; | 740 | Evas_Coord x, y, w, h; |
739 | 741 | ||
740 | clip = evas_object_clip_get(target); | ||
741 | elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h, EINA_TRUE); | 742 | elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h, EINA_TRUE); |
742 | 743 | ||
743 | evas_object_move(obj, x, y); | 744 | evas_object_move(obj, x, y); |
744 | evas_object_resize(obj, w, h); | 745 | evas_object_resize(obj, w, h); |
745 | if (clip) evas_object_clip_set(obj, clip); | 746 | |
747 | if (!_elm_config->focus_highlight_clip_disable) | ||
748 | { | ||
749 | clip = evas_object_clip_get(target); | ||
750 | if (clip) evas_object_clip_set(obj, clip); | ||
751 | } | ||
746 | } | 752 | } |
747 | 753 | ||
748 | static void | 754 | static void |