From: Jin Yoon Date: Mon, 15 Jul 2013 00:54:14 +0000 (+0900) Subject: Focus : Up / Down keys are enabled to focus items on the other page. X-Git-Tag: submit/tizen_2.2/20130716.173435^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b17104bb1d3c3fb1924098f5284349b8fc46232;p=apps%2Fhome%2Fmenu-screen.git Focus : Up / Down keys are enabled to focus items on the other page. --- diff --git a/data/org.tizen.menu-screen.xml.in b/data/org.tizen.menu-screen.xml.in index 68e4420..c79faec 100755 --- a/data/org.tizen.menu-screen.xml.in +++ b/data/org.tizen.menu-screen.xml.in @@ -1,5 +1,5 @@ - + Jin Yoon Youngjoo Park diff --git a/packaging/org.tizen.menu-screen.spec b/packaging/org.tizen.menu-screen.spec index 66de937..f299154 100644 --- a/packaging/org.tizen.menu-screen.spec +++ b/packaging/org.tizen.menu-screen.spec @@ -16,7 +16,7 @@ Name: org.tizen.menu-screen Summary: An utility library of the menu screen -Version: 1.2.0 +Version: 1.2.1 Release: 1.1 Group: TO_BE/FILLED_IN License: Flora Software License diff --git a/src/all_apps/.layout.c.swp b/src/all_apps/.layout.c.swp deleted file mode 100644 index e2fe7a7..0000000 Binary files a/src/all_apps/.layout.c.swp and /dev/null differ diff --git a/src/key.c b/src/key.c index 5b24628..7ddd826 100644 --- a/src/key.c +++ b/src/key.c @@ -51,6 +51,8 @@ static struct { #define KEY_LEFT "Left" #define KEY_RIGHT "Right" +#define KEY_UP "Up" +#define KEY_DOWN "Down" static Eina_Bool _key_release_cb(void *data, int type, void *event) { Evas_Event_Key_Up *ev = event; @@ -78,7 +80,6 @@ static Eina_Bool _key_release_cb(void *data, int type, void *event) Evas_Object *scroller = evas_object_data_get(all_apps, "scroller"); break_if(NULL == scroller); - int left = 0; if (!strcmp(ev->keyname, KEY_SELECT) || !strcmp(ev->keyname, KEY_BACK)) { if (popup_exist()) { popup_destroy_all(); @@ -88,8 +89,10 @@ static Eina_Bool _key_release_cb(void *data, int type, void *event) if (all_apps_layout_is_edited(all_apps)) { all_apps_layout_unedit(all_apps); } - } else if ((left = !strcmp(ev->keyname, KEY_LEFT)) || - !strcmp(ev->keyname, KEY_RIGHT)) + } else if (!strcmp(ev->keyname, KEY_LEFT) || + !strcmp(ev->keyname, KEY_RIGHT) || + !strcmp(ev->keyname, KEY_UP) || + !strcmp(ev->keyname, KEY_DOWN)) { int cur_idx = page_scroller_get_current_page_no(scroller); int idx = 0, x = 0, w = 0; @@ -101,9 +104,11 @@ static Eina_Bool _key_release_cb(void *data, int type, void *event) break; } - int vector = left ? -1 : 1; - if (x % w) { - page_scroller_focus_into_vector(scroller, vector); + /* If there are no items to be focused after pressing keys, + Menu-screen forces to focus the first item of the other page */ + int rest = x % w; + if (rest) { + page_scroller_focus_into_vector(scroller, rest > w / 2 ? -1 : 1); } } } while (0);