summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAnand <anand.km@samsung.com>2014-07-22 15:56:16 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-07-22 15:57:32 +0900
commit91282a22cba66ee5e7799018d3abe8957fb1b1fa (patch)
tree2ade57a87977da8a1de172900704aaadca0a93f8 /src/lib
parent0d014c0dd42d65a5e72eb31b2a53f8fe270d38ed (diff)
genlist: Focus highlight when loop is enable
Summary: This patch is dependent on D1193 and D1136. It will be pushed after D1193 and D1136 patch. Reviewers: singh.amitesh Differential Revision: https://phab.enlightenment.org/D1168 Conflicts: src/lib/elm_genlist.c
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elm_genlist.c69
1 files changed, 54 insertions, 15 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index e874dc7cd..e33a8cfa5 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -2269,7 +2269,7 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj EINA_UNUSED, Elm_Genlist_Pa
2269 else if (sd->reorder_fast == -1) 2269 else if (sd->reorder_fast == -1)
2270 eo_do((sd)->obj, elm_interface_scrollable_content_region_show(vx, vy + 10, vw, vh)); 2270 eo_do((sd)->obj, elm_interface_scrollable_content_region_show(vx, vy + 10, vw, vh));
2271 2271
2272 if (sd->focused_item) 2272 if (sd->focused_item && !sd->item_loop_enable)
2273 _elm_widget_focus_highlight_start(psd->wobj); 2273 _elm_widget_focus_highlight_start(psd->wobj);
2274 2274
2275 evas_event_thaw(evas_object_evas_get(obj)); 2275 evas_event_thaw(evas_object_evas_get(obj));
@@ -5188,42 +5188,73 @@ _decorate_item_unset(Elm_Genlist_Data *sd)
5188 5188
5189static void 5189static void
5190_elm_genlist_looping_up_cb(void *data, 5190_elm_genlist_looping_up_cb(void *data,
5191 Evas_Object *obj EINA_UNUSED, 5191 Evas_Object *obj EINA_UNUSED,
5192 const char *emission EINA_UNUSED, 5192 const char *emission EINA_UNUSED,
5193 const char *source EINA_UNUSED) 5193 const char *source EINA_UNUSED)
5194{ 5194{
5195 Evas_Object *genlist = data; 5195 Evas_Object *genlist = data;
5196 5196
5197 ELM_GENLIST_DATA_GET(genlist, sd); 5197 ELM_GENLIST_DATA_GET(genlist, sd);
5198 5198
5199 Elm_Object_Item *it = elm_genlist_last_item_get(genlist); 5199 Elm_Object_Item *it = elm_genlist_last_item_get(genlist);
5200 if (!_elm_config->item_select_on_focus_disable) 5200
5201 elm_genlist_item_selected_set(it, EINA_TRUE); 5201 elm_genlist_item_show((Elm_Object_Item *)it, ELM_GENLIST_ITEM_SCROLLTO_IN);
5202 else 5202 _elm_widget_focus_highlight_signal_emit(genlist, "elm,action,focus,move,up", "elm");
5203 elm_object_item_focus_set(it, EINA_TRUE);
5204 elm_layout_signal_emit(genlist, "elm,action,looping,up,end", "elm"); 5203 elm_layout_signal_emit(genlist, "elm,action,looping,up,end", "elm");
5205 sd->item_looping_on = EINA_FALSE; 5204 sd->item_looping_on = EINA_FALSE;
5206} 5205}
5207 5206
5208static void 5207static void
5209_elm_genlist_looping_down_cb(void *data, 5208_elm_genlist_looping_down_cb(void *data,
5210 Evas_Object *obj EINA_UNUSED, 5209 Evas_Object *obj EINA_UNUSED,
5211 const char *emission EINA_UNUSED, 5210 const char *emission EINA_UNUSED,
5212 const char *source EINA_UNUSED) 5211 const char *source EINA_UNUSED)
5213{ 5212{
5214 Evas_Object *genlist = data; 5213 Evas_Object *genlist = data;
5215 5214
5216 ELM_GENLIST_DATA_GET(genlist, sd); 5215 ELM_GENLIST_DATA_GET(genlist, sd);
5217 5216
5218 Elm_Object_Item *it = elm_genlist_first_item_get(genlist); 5217 Elm_Object_Item *it = elm_genlist_first_item_get(genlist);
5219 if (!_elm_config->item_select_on_focus_disable) 5218
5220 elm_genlist_item_selected_set(it, EINA_TRUE); 5219 elm_genlist_item_show((Elm_Object_Item *)it, ELM_GENLIST_ITEM_SCROLLTO_IN);
5221 else 5220 _elm_widget_focus_highlight_signal_emit(genlist, "elm,action,focus,move,down", "elm");
5222 elm_object_item_focus_set(it, EINA_TRUE);
5223 elm_layout_signal_emit(genlist, "elm,action,looping,down,end", "elm"); 5221 elm_layout_signal_emit(genlist, "elm,action,looping,down,end", "elm");
5224 sd->item_looping_on = EINA_FALSE; 5222 sd->item_looping_on = EINA_FALSE;
5225} 5223}
5226 5224
5225static void
5226_elm_genlist_focus_highlight_move_down_end_cb(void *data,
5227 Evas_Object *obj EINA_UNUSED,
5228 const char *emission EINA_UNUSED,
5229 const char *source EINA_UNUSED)
5230{
5231 Evas_Object *gl = data;
5232 Elm_Gen_Item *it = (Elm_Gen_Item *)elm_genlist_first_item_get(gl);
5233
5234 if (!_elm_config->item_select_on_focus_disable)
5235 elm_genlist_item_selected_set((Elm_Object_Item *)it, EINA_TRUE);
5236 else
5237 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE);
5238
5239 _elm_widget_focus_highlight_signal_emit(gl, "elm,action,focus,move,home,up", "elm");
5240}
5241
5242static void
5243_elm_genlist_focus_highlight_move_up_end_cb(void *data,
5244 Evas_Object *obj EINA_UNUSED,
5245 const char *emission EINA_UNUSED,
5246 const char *source EINA_UNUSED)
5247{
5248 Evas_Object *gl = data;
5249 Elm_Gen_Item *it = (Elm_Gen_Item *)elm_genlist_last_item_get(gl);
5250
5251 if (!_elm_config->item_select_on_focus_disable)
5252 elm_genlist_item_selected_set((Elm_Object_Item *)it, EINA_TRUE);
5253 else
5254 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE);
5255
5256 _elm_widget_focus_highlight_signal_emit(gl, "elm,action,focus,move,home,down", "elm");
5257}
5227 5258
5228EOLIAN static void 5259EOLIAN static void
5229_elm_genlist_evas_object_smart_add(Eo *obj, Elm_Genlist_Data *priv) 5260_elm_genlist_evas_object_smart_add(Eo *obj, Elm_Genlist_Data *priv)
@@ -7551,6 +7582,14 @@ _elm_genlist_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *
7551EOLIAN static void 7582EOLIAN static void
7552_elm_genlist_elm_widget_item_loop_enabled_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bool enable) 7583_elm_genlist_elm_widget_item_loop_enabled_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bool enable)
7553{ 7584{
7585 if (enable == EINA_TRUE)
7586 {
7587 _elm_widget_focus_highlight_signal_callback_add(obj, "elm,focus,move,down,end",
7588 "elm", _elm_genlist_focus_highlight_move_down_end_cb, obj);
7589 _elm_widget_focus_highlight_signal_callback_add(obj, "elm,focus,move,up,end",
7590 "elm", _elm_genlist_focus_highlight_move_up_end_cb, obj);
7591 }
7592
7554 sd->item_loop_enable = !!enable; 7593 sd->item_loop_enable = !!enable;
7555} 7594}
7556 7595