summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Lee <sh10233.lee@samsung.com>2015-03-11 19:59:58 +0900
committerJaehwan Kim <jae.hwan.kim@samsung.com>2015-03-11 21:07:09 +0900
commit410817eb40a66357bc020fdcab2698999744f4ed (patch)
tree26876c3066edce22d45f068afc46d1f97d6a39ff
parent7177b00a8fcc46bc28b983d776b2532acf371366 (diff)
downloadelementary-410817eb40a66357bc020fdcab2698999744f4ed.tar.gz
Genlist/Gengrid : Modified to handle the focus highlight on unrealized items
Summary: When unrealized item is focused, edje object is not exist, so genlist cannot read the focus highlight information from edje object. Therefore, when the item is realized, check the item is focused or not and need to update focus highlight. @fix Test Plan: change edc for supporting focus highlight in edc, and set focus on unrealized items. Reviewers: raster, seoz, jaehwan Differential Revision: https://phab.enlightenment.org/D2128
-rw-r--r--src/lib/elm_gengrid.c45
-rw-r--r--src/lib/elm_genlist.c38
2 files changed, 65 insertions, 18 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index ecc1e0c73..80a14188d 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -1011,6 +1011,13 @@ _item_realize(Elm_Gen_Item *it)
if (it->mouse_cursor)
eo_do(eo_it, elm_wdg_item_cursor_set(it->mouse_cursor));
+ if (eo_it == sd->focused_item)
+ {
+ _elm_widget_item_highlight_in_theme(WIDGET(it), EO_OBJ(it));
+ _elm_widget_highlight_in_theme_update(WIDGET(it));
+ _elm_widget_focus_highlight_start(WIDGET(it));
+ }
+
it->realized = EINA_TRUE;
it->want_unrealize = EINA_FALSE;
}
@@ -1613,15 +1620,18 @@ _elm_gengrid_item_focused(Elm_Object_Item *eo_it)
sd->focused_item = eo_it;
- if (elm_widget_focus_highlight_enabled_get(obj))
+ if (it->realized)
{
- edje_object_signal_emit
- (VIEW(it), "elm,state,focused", "elm");
- }
+ if (elm_widget_focus_highlight_enabled_get(obj))
+ {
+ edje_object_signal_emit
+ (VIEW(it), "elm,state,focused", "elm");
+ }
- focus_raise = edje_object_data_get(VIEW(it), "focusraise");
- if ((focus_raise) && (!strcmp(focus_raise, "on")))
- evas_object_raise(VIEW(it));
+ focus_raise = edje_object_data_get(VIEW(it), "focusraise");
+ if ((focus_raise) && (!strcmp(focus_raise, "on")))
+ evas_object_raise(VIEW(it));
+ }
evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, eo_it);
}
@@ -3455,9 +3465,24 @@ _elm_gengrid_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bo
_elm_gengrid_item_unfocused(sd->focused_item);
_elm_gengrid_item_focused(eo_it);
- _elm_widget_item_highlight_in_theme(obj, eo_it);
- _elm_widget_highlight_in_theme_update(obj);
- _elm_widget_focus_highlight_start(obj);
+ /* If item is not realized state, widget couldn't get focus_highlight data. */
+ if (it->realized)
+ {
+ const char *focus_raise;
+ if (elm_widget_focus_highlight_enabled_get(obj))
+ {
+ edje_object_signal_emit
+ (VIEW(it), "elm,state,focused", "elm");
+ }
+
+ focus_raise = edje_object_data_get(VIEW(it), "focusraise");
+ if ((focus_raise) && (!strcmp(focus_raise, "on")))
+ evas_object_raise(VIEW(it));
+
+ _elm_widget_item_highlight_in_theme(obj, eo_it);
+ _elm_widget_highlight_in_theme_update(obj);
+ _elm_widget_focus_highlight_start(obj);
+ }
}
}
else
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 068ae6857..299cbecca 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -1699,6 +1699,21 @@ _item_realize(Elm_Gen_Item *it,
_elm_genlist_item_state_update(it, itc);
_elm_genlist_item_index_update(it);
+
+ if (EO_OBJ(it) == sd->focused_item)
+ {
+ const char *focus_raise;
+ if (elm_widget_focus_highlight_enabled_get(WIDGET(it)))
+ edje_object_signal_emit(VIEW(it), SIGNAL_FOCUSED, "elm");
+
+ focus_raise = edje_object_data_get(VIEW(it), "focusraise");
+ if ((focus_raise) && (!strcmp(focus_raise, "on")))
+ evas_object_raise(VIEW(it));
+
+ _elm_widget_item_highlight_in_theme(WIDGET(it), EO_OBJ(it));
+ _elm_widget_highlight_in_theme_update(WIDGET(it));
+ _elm_widget_focus_highlight_start(WIDGET(it));
+ }
}
/* homogeneous genlist shortcut */
@@ -2538,12 +2553,15 @@ _elm_genlist_item_focused(Elm_Object_Item *eo_it)
sd->focused_item = eo_it;
- if (elm_widget_focus_highlight_enabled_get(obj))
- edje_object_signal_emit(VIEW(it), SIGNAL_FOCUSED, "elm");
+ if (it->realized)
+ {
+ if (elm_widget_focus_highlight_enabled_get(obj))
+ edje_object_signal_emit(VIEW(it), SIGNAL_FOCUSED, "elm");
- focus_raise = edje_object_data_get(VIEW(it), "focusraise");
- if ((focus_raise) && (!strcmp(focus_raise, "on")))
- evas_object_raise(VIEW(it));
+ focus_raise = edje_object_data_get(VIEW(it), "focusraise");
+ if ((focus_raise) && (!strcmp(focus_raise, "on")))
+ evas_object_raise(VIEW(it));
+ }
evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, eo_it);
}
@@ -5768,9 +5786,13 @@ _elm_genlist_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bo
_elm_genlist_item_unfocused(sd->focused_item);
_elm_genlist_item_focused(eo_it);
- _elm_widget_item_highlight_in_theme(obj, EO_OBJ(it));
- _elm_widget_highlight_in_theme_update(obj);
- _elm_widget_focus_highlight_start(obj);
+ /* If item is not realized state, widget couldn't get focus_highlight data. */
+ if (it->realized)
+ {
+ _elm_widget_item_highlight_in_theme(obj, EO_OBJ(it));
+ _elm_widget_highlight_in_theme_update(obj);
+ _elm_widget_focus_highlight_start(obj);
+ }
}
}
else