raster pushed a commit to branch master.

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

commit ac42719b7dfe364f75e06befdbcd045482962bc8
Author: Anil Kumar Nahak <[email protected]>
Date:   Tue Jun 10 19:29:47 2014 +0900

    genlist: Focus out of genlist viewport area on resize fixed
    
    Summary:
    The focus of genlist was coming out of genlist's viewport area on 
resizing(shrinking).
    This is fixed in this patch.
    
    Test Plan: elementary_test -to genlist5, elementary_test -to fileselector
    
    Reviewers: seoz, singh.amitesh, nirajkr
    
    Differential Revision: https://phab.enlightenment.org/D949
---
 src/bin/test_genlist.c |  1 +
 src/lib/elm_genlist.c  | 23 ++++++++++-------------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c
index d78f645..d629356 100644
--- a/src/bin/test_genlist.c
+++ b/src/bin/test_genlist.c
@@ -1151,6 +1151,7 @@ test_genlist5(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *event_
 
    win = elm_win_util_standard_add("genlist5", "Genlist 5");
    elm_win_autodel_set(win, EINA_TRUE);
+   elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
 
    bx = elm_box_add(win);
    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 406098a..6e7b1be 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -7463,9 +7463,9 @@ elm_genlist_nth_item_get(const Evas_Object *obj, unsigned 
int nth)
 EOLIAN static void
 _elm_genlist_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, 
Elm_Genlist_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord 
*h)
 {
-   Evas_Coord ox, oy, oh, item_x = 0, item_y = 0, item_w = 0, item_h = 0;
+   Evas_Coord ox, oy, oh, ow, item_x = 0, item_y = 0, item_w = 0, item_h = 0;
 
-   evas_object_geometry_get(sd->pan_obj, &ox, &oy, NULL, &oh);
+   evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
 
    if (sd->focused_item)
      {
@@ -7473,26 +7473,23 @@ _elm_genlist_elm_widget_focus_highlight_geometry_get(Eo 
*obj EINA_UNUSED, Elm_Ge
         
elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->focused_item), 
&item_x, &item_y, &item_w, &item_h);
      }
 
+   *x = item_x;
+   *y = item_y;
+   *w = item_w;
+   *h = item_h;
+
    if (item_y < oy)
      {
-        *x = ox;
         *y = oy;
-        *w = item_w;
-        *h = item_h;
      }
    else if (item_y > (oy + oh - item_h))
      {
-        *x = ox;
         *y = oy + oh - item_h;
-        *w = item_w;
-        *h = item_h;
      }
-   else
+
+   if ((item_x + item_w) > (ox + ow))
      {
-        *x = item_x;
-        *y = item_y;
-        *w = item_w;
-        *h = item_h;
+        *w = item_w - (item_w - ow);
      }
 }
 

-- 


Reply via email to