cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=fd58b8d09ec624cca0aba7afcebf6ac92a7176de

commit fd58b8d09ec624cca0aba7afcebf6ac92a7176de
Author: Jee-Yong Um <jc9...@samsung.com>
Date:   Wed Feb 17 17:02:14 2016 -0800

    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 <ced...@osg.samsung.com>
---
 src/lib/elm_gengrid.c | 7 ++++++-
 src/lib/elm_genlist.c | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 3d93480..af51cb5 100644
--- a/src/lib/elm_gengrid.c
+++ b/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/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index cc2fdcf..d41e61d 100644
--- a/src/lib/elm_genlist.c
+++ b/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;

-- 


Reply via email to