summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrince Kr Dubey <prince.dubey@gmail.com>2015-06-25 16:38:28 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-06-25 17:24:08 +0200
commit2392ee830beccea338c2284ec2a5d2466b808439 (patch)
treea8f1dd53c7b444cec0471a8b1816c1a2ae59d470
parent80c8cfb7a244d770102b9411f84cfc8e84192190 (diff)
elm_gengrid: fix an overlap issue of item and group item on focus.
Summary: Issue: Gengrid item comes over group item on click. Test Plan: Run elementary test. Open GenGrid Group. Click on any item which slightly overlap with group item. Item comes over group item. Reviewers: raster, cedric Reviewed By: cedric Subscribers: rajeshps, govi, poornima.srinivasan, shilpasingh Differential Revision: https://phab.enlightenment.org/D2589 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_gengrid.c67
1 files changed, 32 insertions, 35 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 70f30ec7f..faef8a147 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -1273,6 +1273,34 @@ _access_widget_item_register(Elm_Gen_Item *it)
1273} 1273}
1274 1274
1275static void 1275static void
1276_elm_gengrid_item_focus_raise(Elm_Gen_Item *it)
1277{
1278 const char *focus_raise;
1279 Evas_Object *obj = WIDGET(it);
1280 ELM_GENGRID_DATA_GET(obj, sd);
1281
1282 if (elm_widget_focus_highlight_enabled_get(obj))
1283 {
1284 edje_object_signal_emit
1285 (VIEW(it), "elm,state,focused", "elm");
1286 }
1287
1288 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
1289 if ((focus_raise) && (!strcmp(focus_raise, "on")))
1290 {
1291 Elm_Gen_Item *it1;
1292 Eina_List *l;
1293
1294 evas_object_raise(VIEW(it));
1295 EINA_LIST_FOREACH(sd->group_items, l, it1)
1296 {
1297 if (GG_IT(it1)->group_realized)
1298 evas_object_raise(VIEW(it1));
1299 }
1300 }
1301}
1302
1303static void
1276_item_realize(Elm_Gen_Item *it) 1304_item_realize(Elm_Gen_Item *it)
1277{ 1305{
1278 Eina_Bool tmp; 1306 Eina_Bool tmp;
@@ -1361,17 +1389,7 @@ _item_realize(Elm_Gen_Item *it)
1361 1389
1362 if (eo_it == sd->focused_item) 1390 if (eo_it == sd->focused_item)
1363 { 1391 {
1364 const char *focus_raise; 1392 _elm_gengrid_item_focus_raise(it);
1365 if (elm_widget_focus_highlight_enabled_get(WIDGET(it)))
1366 {
1367 edje_object_signal_emit
1368 (VIEW(it), "elm,state,focused", "elm");
1369 }
1370
1371 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
1372 if ((focus_raise) && (!strcmp(focus_raise, "on")))
1373 evas_object_raise(VIEW(it));
1374
1375 _elm_widget_item_highlight_in_theme(WIDGET(it), EO_OBJ(it)); 1393 _elm_widget_item_highlight_in_theme(WIDGET(it), EO_OBJ(it));
1376 _elm_widget_highlight_in_theme_update(WIDGET(it)); 1394 _elm_widget_highlight_in_theme_update(WIDGET(it));
1377 _elm_widget_focus_highlight_start(WIDGET(it)); 1395 _elm_widget_focus_highlight_start(WIDGET(it));
@@ -1794,6 +1812,7 @@ _group_item_place(Elm_Gengrid_Pan_Data *psd)
1794 iw = vw; 1812 iw = vw;
1795 ih = psd->wsd->group_item_height; 1813 ih = psd->wsd->group_item_height;
1796 } 1814 }
1815
1797 EINA_LIST_FOREACH(psd->wsd->group_items, l, it) 1816 EINA_LIST_FOREACH(psd->wsd->group_items, l, it)
1798 { 1817 {
1799 was_realized = it->realized; 1818 was_realized = it->realized;
@@ -1961,7 +1980,6 @@ _elm_gengrid_item_focused(Elm_Object_Item *eo_it)
1961 ELM_GENGRID_ITEM_DATA_GET(eo_it, it); 1980 ELM_GENGRID_ITEM_DATA_GET(eo_it, it);
1962 Evas_Object *obj = WIDGET(it); 1981 Evas_Object *obj = WIDGET(it);
1963 ELM_GENGRID_DATA_GET(obj, sd); 1982 ELM_GENGRID_DATA_GET(obj, sd);
1964 const char *focus_raise;
1965 1983
1966 if (it->generation < sd->generation) 1984 if (it->generation < sd->generation)
1967 return; 1985 return;
@@ -1987,18 +2005,7 @@ _elm_gengrid_item_focused(Elm_Object_Item *eo_it)
1987 2005
1988 sd->focused_item = eo_it; 2006 sd->focused_item = eo_it;
1989 2007
1990 if (it->realized) 2008 if (it->realized) _elm_gengrid_item_focus_raise(it);
1991 {
1992 if (elm_widget_focus_highlight_enabled_get(obj))
1993 {
1994 edje_object_signal_emit
1995 (VIEW(it), "elm,state,focused", "elm");
1996 }
1997
1998 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
1999 if ((focus_raise) && (!strcmp(focus_raise, "on")))
2000 evas_object_raise(VIEW(it));
2001 }
2002 evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, eo_it); 2009 evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, eo_it);
2003 if (_elm_config->atspi_mode) 2010 if (_elm_config->atspi_mode)
2004 elm_interface_atspi_accessible_state_changed_signal_emit(eo_it, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE); 2011 elm_interface_atspi_accessible_state_changed_signal_emit(eo_it, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
@@ -3849,17 +3856,7 @@ _elm_gengrid_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bo
3849 /* If item is not realized state, widget couldn't get focus_highlight data. */ 3856 /* If item is not realized state, widget couldn't get focus_highlight data. */
3850 if (it->realized) 3857 if (it->realized)
3851 { 3858 {
3852 const char *focus_raise; 3859 _elm_gengrid_item_focus_raise(it);
3853 if (elm_widget_focus_highlight_enabled_get(obj))
3854 {
3855 edje_object_signal_emit
3856 (VIEW(it), "elm,state,focused", "elm");
3857 }
3858
3859 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
3860 if ((focus_raise) && (!strcmp(focus_raise, "on")))
3861 evas_object_raise(VIEW(it));
3862
3863 _elm_widget_item_highlight_in_theme(obj, eo_it); 3860 _elm_widget_item_highlight_in_theme(obj, eo_it);
3864 _elm_widget_highlight_in_theme_update(obj); 3861 _elm_widget_highlight_in_theme_update(obj);
3865 _elm_widget_focus_highlight_start(obj); 3862 _elm_widget_focus_highlight_start(obj);