From f34b1d40fac9749b13825ccb2937c5029205e7d0 Mon Sep 17 00:00:00 2001 From: Jee-Yong Um Date: Wed, 17 Feb 2016 17:02:14 -0800 Subject: [PATCH] elm_gen: highlight itself when there are no items Summary: When there are no items in genlist/gengrid, highlight stays at one dot of top-left corner. This patch makes genlist/gengrid itself highlighted when there are no items. Reviewers: jpeg, SanghyeonLee Differential Revision: https://phab.enlightenment.org/D3701 Signed-off-by: Cedric BAIL --- legacy/elementary/src/lib/elm_gengrid.c | 7 ++++++- legacy/elementary/src/lib/elm_genlist.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c index 3d93480ccc..af51cb543d 100644 --- a/legacy/elementary/src/lib/elm_gengrid.c +++ b/legacy/elementary/src/lib/elm_gengrid.c @@ -5565,7 +5565,7 @@ elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth) } EOLIAN static void -_elm_gengrid_elm_widget_focus_highlight_geometry_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +_elm_gengrid_elm_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Gengrid_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) { Evas_Coord ox, oy, oh, ow, item_x = 0, item_y = 0, item_w = 0, item_h = 0; @@ -5577,6 +5577,11 @@ _elm_gengrid_elm_widget_focus_highlight_geometry_get(const Eo *obj EINA_UNUSED, evas_object_geometry_get(VIEW(focus_it), &item_x, &item_y, &item_w, &item_h); elm_widget_focus_highlight_focus_part_geometry_get(VIEW(focus_it), &item_x, &item_y, &item_w, &item_h); } + else + { + evas_object_geometry_get(obj, x, y, w, h); + return; + } *x = item_x; *y = item_y; diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index cc2fdcfe78..d41e61d62c 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -8223,7 +8223,7 @@ elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth) } EOLIAN static void -_elm_genlist_elm_widget_focus_highlight_geometry_get(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +_elm_genlist_elm_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Genlist_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) { Evas_Coord ox, oy, oh, ow, item_x = 0, item_y = 0, item_w = 0, item_h = 0; @@ -8235,6 +8235,11 @@ _elm_genlist_elm_widget_focus_highlight_geometry_get(const Eo *obj EINA_UNUSED, evas_object_geometry_get(VIEW(focus_it), &item_x, &item_y, &item_w, &item_h); elm_widget_focus_highlight_focus_part_geometry_get(VIEW(focus_it), &item_x, &item_y, &item_w, &item_h); } + else + { + evas_object_geometry_get(obj, x, y, w, h); + return; + } *x = item_x; *y = item_y;