seoz pushed a commit to branch elementary-1.9.

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

commit 9c6edc463d944bcb600d81f6168f2e2f0068bb4b
Author: Daniel Juyung Seo <seojuyu...@gmail.com>
Date:   Tue Mar 18 19:14:39 2014 +0900

    list/genlist: Fixed Home and End key event handling routine.
    
    Move selection when Home or End key is pressed.
    
    @fix
    This is a partial port from master.
---
 src/lib/elm_genlist.c | 24 ++++++++++++++----------
 src/lib/elm_list.c    | 22 ++++++++++++++--------
 2 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index f7414ac..94af9a0 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -2552,21 +2552,25 @@ _elm_genlist_smart_event(Eo *obj, void *_pd, va_list 
*list)
             ((!strcmp(ev->key, "KP_Home")) && (!ev->string)))
      {
         it = elm_genlist_first_item_get(obj);
-        elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_IN);
-        elm_genlist_item_selected_set(it, EINA_TRUE);
-        ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
-        if (ret) *ret = EINA_TRUE;
-        return;
+        if (it)
+          {
+             elm_genlist_item_selected_set(it, EINA_TRUE);
+             ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+             if (ret) *ret = EINA_TRUE;
+             return;
+          }
      }
    else if ((!strcmp(ev->key, "End")) ||
             ((!strcmp(ev->key, "KP_End")) && (!ev->string)))
      {
         it = elm_genlist_last_item_get(obj);
-        elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_IN);
-        elm_genlist_item_selected_set(it, EINA_TRUE);
-        ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
-        if (ret) *ret = EINA_TRUE;
-        return;
+        if (it)
+          {
+             elm_genlist_item_selected_set(it, EINA_TRUE);
+             ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+             if (ret) *ret = EINA_TRUE;
+             return;
+          }
      }
    else if ((!strcmp(ev->key, "Prior")) ||
             ((!strcmp(ev->key, "KP_Prior")) && (!ev->string)))
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index c914978..a6d6a62 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -365,19 +365,25 @@ _elm_list_smart_event(Eo *obj, void *_pd, va_list *list)
             ((!strcmp(ev->key, "KP_Home")) && !ev->string))
      {
         it = eina_list_data_get(sd->items);
-        elm_list_item_bring_in((Elm_Object_Item *)it);
-        ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
-        if (ret) *ret = EINA_TRUE;
-        return;
+        if (it)
+          {
+             elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE);
+             ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+             if (ret) *ret = EINA_TRUE;
+             return;
+          }
      }
    else if ((!strcmp(ev->key, "End")) ||
             ((!strcmp(ev->key, "KP_End")) && !ev->string))
      {
         it = eina_list_data_get(eina_list_last(sd->items));
-        elm_list_item_bring_in((Elm_Object_Item *)it);
-        ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
-        if (ret) *ret = EINA_TRUE;
-        return;
+        if (it)
+          {
+             elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE);
+             ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+             if (ret) *ret = EINA_TRUE;
+             return;
+          }
      }
    else if ((!strcmp(ev->key, "Prior")) ||
             ((!strcmp(ev->key, "KP_Prior")) && !ev->string))

-- 


Reply via email to