base: manage current focused menu button 74/42874/2
authorJehun Lim <jehun.lim@samsung.com>
Fri, 3 Jul 2015 10:02:42 +0000 (19:02 +0900)
committerJehun Lim <jehun.lim@samsung.com>
Fri, 3 Jul 2015 10:08:26 +0000 (19:08 +0900)
Change-Id: I9c671b2f25172788abaf3550afc7d459a7098cbf
Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
src/view/base.c

index b007ef7..07247de 100644 (file)
@@ -31,6 +31,7 @@ struct _priv {
        Evas_Object *win;
        Evas_Object *base;
        Evas_Object *btn[MENU_BTN_SIZE];
+       Evas_Object *focused_btn;
 
        layoutmgr *lmgr;
 
@@ -77,12 +78,15 @@ static void _focused_cb(int id, void *data, Evas_Object *obj,
 
        priv = data;
 
+       if (priv->focused_btn == obj)
+               return;
+
        for (i = 0; i < MENU_BTN_SIZE; i++) {
                if (priv->btn[i] == obj)
                        break;
        }
 
-       if (i == priv->current_layout || i == MENU_BTN_SIZE)
+       if (i == MENU_BTN_SIZE)
                return;
 
        layoutmgr_hide_layout(priv->lmgr,
@@ -90,6 +94,7 @@ static void _focused_cb(int id, void *data, Evas_Object *obj,
        layoutmgr_show_layout(priv->lmgr, g_menu_item[i].layout_id);
        layoutmgr_update_layout(priv->lmgr, g_menu_item[i].layout_id, 0, NULL);
 
+       priv->focused_btn = obj;
        priv->current_layout = i;
 }