summaryrefslogtreecommitdiff
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-25 00:40:30 +0900
commitde7bf97411155dea226a0c633c5856b7292fe23c (patch)
tree65ea08990a7c65aa39ce51b1c777f48583fffe60
parente272806917550acca1cff8eb456f351b53d0c281 (diff)
downloadelementary-devs/seoz/pre1.10.tar.gz
list: focus highlight is handled by item theme.devs/seoz/pre1.10
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
-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 bb3416d76..3cc584437 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -975,6 +975,11 @@ _elm_list_smart_theme(Eo *obj, void *_pd, va_list *list)
}
_items_fix(obj);
+
+ //focus highlight in_theme is set by list item theme.
+ _elm_widget_item_highlight_in_theme(
+ obj, elm_list_first_item_get(obj));
+
elm_layout_sizing_eval(obj);
if (ret) *ret = EINA_TRUE;
@@ -2518,6 +2523,12 @@ _item_append(Eo *obj, void *_pd, va_list *list)
it = _item_new(obj, label, icon, end, func, data);
+ if (!sd->in_theme_checked)
+ {
+ _elm_widget_item_highlight_in_theme(obj, (Elm_Object_Item *)it);
+ sd->in_theme_checked = EINA_TRUE;
+ }
+
sd->items = eina_list_append(sd->items, it);
it->node = eina_list_last(sd->items);
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)
}
void
+_elm_widget_item_highlight_in_theme(Evas_Object *obj, Elm_Object_Item *it)
+{
+ const char *str;
+
+ if (!it) return;
+ str = edje_object_data_get(VIEW(it), "focus_highlight");
+ if ((str) && (!strcmp(str, "on")))
+ elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
+ else
+ elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
+}
+
+void
_elm_widget_focus_highlight_start(const Evas_Object *obj)
{
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);
EAPI void elm_widget_item_untrack(Elm_Widget_Item *item);
EAPI int elm_widget_item_track_get(const Elm_Widget_Item *item);
EAPI void _elm_widget_item_track_cancel(Elm_Widget_Item *item);
+void _elm_widget_item_highlight_in_theme(Evas_Object *obj, Elm_Object_Item *it);
/**
* 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
Eina_Bool multi : 1;
Eina_Bool swipe : 1;
Eina_Bool delete_me : 1;
+ Eina_Bool in_theme_checked : 1; /**< flag for setting item highlight in theme. */
};
typedef 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)
if (!elm_win_focus_highlight_enabled_get(obj)) return;
sd->focus_highlight.cur.visible = EINA_TRUE;
- sd->focus_highlight.cur.in_theme = EINA_FALSE;
sd->focus_highlight.geometry_changed = EINA_TRUE;
_elm_win_focus_highlight_reconfigure(sd);
}