summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2014-02-22 04:09:46 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-02-26 01:27:05 +0900
commit8c1e9aefb605e2488080a46cfe42edefdd0ffcd9 (patch)
treefaadc5a7e5bc849d27a5327387191afdb383820a /src/lib
parente2417e4bb674c76277906c1a94a5c9896ea2fa5d (diff)
list: focus highlight is handled by item theme.
Summary: Problem: list theme (elm/list/base/default) is an alias of scroller base theme (elm/scroller/base/default) in which focus_highlight is set to "on". Solution: Now focus highlight in_theme is set by list item theme. Test Plan: elementary_test->"List Focus" Reviewers: seoz, woohyun Reviewed By: seoz CC: nirajkr Differential Revision: https://phab.enlightenment.org/D572
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elm_list.c11
-rw-r--r--src/lib/elm_widget.c13
-rw-r--r--src/lib/elm_widget.h1
-rw-r--r--src/lib/elm_widget_list.h1
-rw-r--r--src/lib/elm_win.c1
5 files changed, 26 insertions, 1 deletions
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 7efa425f4..f81f643dd 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -980,6 +980,11 @@ _elm_list_smart_theme(Eo *obj, void *_pd, va_list *list)
980 } 980 }
981 981
982 _items_fix(obj); 982 _items_fix(obj);
983
984 //focus highlight in_theme is set by list item theme.
985 _elm_widget_item_highlight_in_theme(
986 obj, elm_list_first_item_get(obj));
987
983 elm_layout_sizing_eval(obj); 988 elm_layout_sizing_eval(obj);
984 989
985 if (ret) *ret = EINA_TRUE; 990 if (ret) *ret = EINA_TRUE;
@@ -2523,6 +2528,12 @@ _item_append(Eo *obj, void *_pd, va_list *list)
2523 2528
2524 it = _item_new(obj, label, icon, end, func, data); 2529 it = _item_new(obj, label, icon, end, func, data);
2525 2530
2531 if (!sd->in_theme_checked)
2532 {
2533 _elm_widget_item_highlight_in_theme(obj, (Elm_Object_Item *)it);
2534 sd->in_theme_checked = EINA_TRUE;
2535 }
2536
2526 sd->items = eina_list_append(sd->items, it); 2537 sd->items = eina_list_append(sd->items, it);
2527 it->node = eina_list_last(sd->items); 2538 it->node = eina_list_last(sd->items);
2528 elm_box_pack_end(sd->box, VIEW(it)); 2539 elm_box_pack_end(sd->box, VIEW(it));
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 464352a67..20ce48f10 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -84,6 +84,19 @@ _elm_scrollable_is(const Evas_Object *obj)
84} 84}
85 85
86void 86void
87_elm_widget_item_highlight_in_theme(Evas_Object *obj, Elm_Object_Item *it)
88{
89 const char *str;
90
91 if (!it) return;
92 str = edje_object_data_get(VIEW(it), "focus_highlight");
93 if ((str) && (!strcmp(str, "on")))
94 elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
95 else
96 elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
97}
98
99void
87_elm_widget_focus_highlight_start(const Evas_Object *obj) 100_elm_widget_focus_highlight_start(const Evas_Object *obj)
88{ 101{
89 Evas_Object *top = elm_widget_top_get(obj); 102 Evas_Object *top = elm_widget_top_get(obj);
diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h
index a127dd500..137717990 100644
--- a/src/lib/elm_widget.h
+++ b/src/lib/elm_widget.h
@@ -810,6 +810,7 @@ EAPI Evas_Object *elm_widget_item_track(Elm_Widget_Item *item);
810EAPI void elm_widget_item_untrack(Elm_Widget_Item *item); 810EAPI void elm_widget_item_untrack(Elm_Widget_Item *item);
811EAPI int elm_widget_item_track_get(const Elm_Widget_Item *item); 811EAPI int elm_widget_item_track_get(const Elm_Widget_Item *item);
812EAPI void _elm_widget_item_track_cancel(Elm_Widget_Item *item); 812EAPI void _elm_widget_item_track_cancel(Elm_Widget_Item *item);
813void _elm_widget_item_highlight_in_theme(Evas_Object *obj, Elm_Object_Item *it);
813 814
814/** 815/**
815 * Function to operate on a given widget's scrollabe children when necessary. 816 * Function to operate on a given widget's scrollabe children when necessary.
diff --git a/src/lib/elm_widget_list.h b/src/lib/elm_widget_list.h
index 06562da29..ccef1877f 100644
--- a/src/lib/elm_widget_list.h
+++ b/src/lib/elm_widget_list.h
@@ -53,6 +53,7 @@ struct _Elm_List_Smart_Data
53 Eina_Bool multi : 1; 53 Eina_Bool multi : 1;
54 Eina_Bool swipe : 1; 54 Eina_Bool swipe : 1;
55 Eina_Bool delete_me : 1; 55 Eina_Bool delete_me : 1;
56 Eina_Bool in_theme_checked : 1; /**< flag for setting item highlight in theme. */
56}; 57};
57 58
58typedef struct _Elm_List_Item Elm_List_Item; 59typedef struct _Elm_List_Item Elm_List_Item;
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 53a707b09..16ecab1ef 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -5830,7 +5830,6 @@ _elm_win_focus_highlight_start(Evas_Object *obj)
5830 5830
5831 if (!elm_win_focus_highlight_enabled_get(obj)) return; 5831 if (!elm_win_focus_highlight_enabled_get(obj)) return;
5832 sd->focus_highlight.cur.visible = EINA_TRUE; 5832 sd->focus_highlight.cur.visible = EINA_TRUE;
5833 sd->focus_highlight.cur.in_theme = EINA_FALSE;
5834 sd->focus_highlight.geometry_changed = EINA_TRUE; 5833 sd->focus_highlight.geometry_changed = EINA_TRUE;
5835 _elm_win_focus_highlight_reconfigure(sd); 5834 _elm_win_focus_highlight_reconfigure(sd);
5836} 5835}