View: Enabled the action menu buttons focused 58/46058/2
authorHyojung Jo <hj903.jo@samsung.com>
Thu, 13 Aug 2015 11:50:47 +0000 (20:50 +0900)
committerHyojung Jo <hj903.jo@samsung.com>
Thu, 13 Aug 2015 12:00:00 +0000 (21:00 +0900)
Change-Id: I7fe897704afc0d4d99f0e77def6474f70f58dea7
Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
14 files changed:
include/define.h
res/images/btn_menu_del_foc.png [new file with mode: 0644]
res/images/btn_menu_del_nor.png [new file with mode: 0644]
res/images/btn_menu_del_sel.png [new file with mode: 0644]
res/images/btn_menu_favorite_dis.png [new file with mode: 0644]
res/images/btn_menu_favorite_foc.png [new file with mode: 0644]
res/images/btn_menu_favorite_sel.png [new file with mode: 0644]
res/images/btn_menu_lock_foc.png [new file with mode: 0644]
res/images/btn_menu_lock_nor.png [new file with mode: 0644]
res/images/btn_menu_lock_sel.png [new file with mode: 0644]
res/view/action_menu.edc
res/widget/button.edc
src/view/view_action_menu.c
src/view/view_base.c

index 99bb79fb46d7c4c415a06ede2d81c60d0335fd8c..d8d2b84ad0ff3003f1f0ba55934bfb2b235fa392 100644 (file)
@@ -53,7 +53,9 @@
 #define STYLE_SORT_CTXPOPUP "style.sort.ctxpopup"
 #define STYLE_APP "style.app"
 #define STYLE_LIVETV_BTN "style.livetv.button"
-#define STYLE_ACTION_MENU_BTN "style.action.menu.button"
+#define STYLE_ACTION_MENU_FAV_BTN "style.action.menu.favorite.button"
+#define STYLE_ACTION_MENU_LOCK_BTN "style.action.menu.lock.button"
+#define STYLE_ACTION_MENU_UNINSTALL_BTN "style.action.menu.uninstall.button"
 
 /* Signal */
 #define SIG_FOCUSED "focused"
@@ -72,6 +74,8 @@
 #define SRC_MYAPPS "source.myapps"
 #define SRC_MENU_BTN "source.menu.btn"
 #define SRC_SORT_BTN "source.sort.btn"
+#define SRC_LIVETV_BTN "source.livetv.btn"
+#define SRC_ACTION_BTN "source.action.btn"
 
 /* Font */
 #define FONT_TIZENSANS_REGULAR "TizenSans"
 #define ARROW_ICON_UP_FOC_PNG "btn_option_arrow_foc_up.png"
 #define ARROW_ICON_SEL_PNG "btn_option_arrow_sel.png"
 #define ARROW_ICON_DISABLE_PNG "btn_option_arrow_dis.png"
-#define ACTION_FAV_NOR_PNG IMGDIR"/btn_menu_favorite_nor.png"
-#define ACTION_LOCK_DIS_PNG IMGDIR"/btn_menu_lock_dis.png"
-#define ACTION_UNINSTALL_DIS_PNG IMGDIR"/btn_menu_del_dis.png"
+#define ACTION_FAV_NOR_PNG "btn_menu_favorite_nor.png"
+#define ACTION_FAV_FOC_PNG "btn_menu_favorite_foc.png"
+#define ACTION_FAV_SEL_PNG "btn_menu_favorite_sel.png"
+#define ACTION_FAV_DIS_PNG "btn_menu_favorite_dis.png"
+#define ACTION_LOCK_NOR_PNG "btn_menu_lock_nor.png"
+#define ACTION_LOCK_FOC_PNG "btn_menu_lock_foc.png"
+#define ACTION_LOCK_SEL_PNG "btn_menu_lock_sel.png"
+#define ACTION_LOCK_DIS_PNG "btn_menu_lock_dis.png"
+#define ACTION_UNINSTALL_NOR_PNG "btn_menu_del_nor.png"
+#define ACTION_UNINSTALL_FOC_PNG "btn_menu_del_foc.png"
+#define ACTION_UNINSTALL_SEL_PNG "btn_menu_del_sel.png"
+#define ACTION_UNINSTALL_DIS_PNG "btn_menu_del_dis.png"
 
 /* Transition */
 #define TRANSITION_FOCUS DECELERATE 0.20
diff --git a/res/images/btn_menu_del_foc.png b/res/images/btn_menu_del_foc.png
new file mode 100644 (file)
index 0000000..dfdfb40
Binary files /dev/null and b/res/images/btn_menu_del_foc.png differ
diff --git a/res/images/btn_menu_del_nor.png b/res/images/btn_menu_del_nor.png
new file mode 100644 (file)
index 0000000..169874f
Binary files /dev/null and b/res/images/btn_menu_del_nor.png differ
diff --git a/res/images/btn_menu_del_sel.png b/res/images/btn_menu_del_sel.png
new file mode 100644 (file)
index 0000000..5dcc990
Binary files /dev/null and b/res/images/btn_menu_del_sel.png differ
diff --git a/res/images/btn_menu_favorite_dis.png b/res/images/btn_menu_favorite_dis.png
new file mode 100644 (file)
index 0000000..bd9bdd8
Binary files /dev/null and b/res/images/btn_menu_favorite_dis.png differ
diff --git a/res/images/btn_menu_favorite_foc.png b/res/images/btn_menu_favorite_foc.png
new file mode 100644 (file)
index 0000000..e4915d5
Binary files /dev/null and b/res/images/btn_menu_favorite_foc.png differ
diff --git a/res/images/btn_menu_favorite_sel.png b/res/images/btn_menu_favorite_sel.png
new file mode 100644 (file)
index 0000000..bd2eeee
Binary files /dev/null and b/res/images/btn_menu_favorite_sel.png differ
diff --git a/res/images/btn_menu_lock_foc.png b/res/images/btn_menu_lock_foc.png
new file mode 100644 (file)
index 0000000..5671cfc
Binary files /dev/null and b/res/images/btn_menu_lock_foc.png differ
diff --git a/res/images/btn_menu_lock_nor.png b/res/images/btn_menu_lock_nor.png
new file mode 100644 (file)
index 0000000..5f38494
Binary files /dev/null and b/res/images/btn_menu_lock_nor.png differ
diff --git a/res/images/btn_menu_lock_sel.png b/res/images/btn_menu_lock_sel.png
new file mode 100644 (file)
index 0000000..1baa790
Binary files /dev/null and b/res/images/btn_menu_lock_sel.png differ
index 0b700f5741aca4b23c457a964fa69410019b277a..b3eedf8f70c2a52afbb8cf3193f14645469e6436 100644 (file)
 group {
        name, GRP_VIEW_ACTION_MENU;
        parts {
+               part {
+                       name, "bg.dark";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 0 0 0 150;
+                       }
+               }
+
                part {
                        name, "bg";
                        type, RECT;
index 261af9ec65cdb592cd113124bd95ed8724b860f8..612553b6dbe3aec9ddaf6b46a24a9d802851f7f3 100644 (file)
@@ -16,6 +16,7 @@
 
 #define STATE_NORMAL 0
 #define STATE_SELECTED 1
+#define STATE_DISABLE 2
 
 group {
        name, "elm/button/base/style.menu.button";
@@ -142,9 +143,7 @@ group {
                                        to, "part.bg";
                                        relative, 0.0 1.0;
                                }
-                               rel2 {
-                                       to, "part.bg";
-                               }
+                               rel2.to, "part.bg";
                                align, 0.5 1.0;
                                fixed, 0 1;
                                visible, 0;
@@ -310,7 +309,7 @@ group {
                }
 
                part {
-                       name, "part.part.inside.line.up";
+                       name, "part.inside.line.up";
                        type, RECT;
                        scale, 1;
                        description {
@@ -339,7 +338,7 @@ group {
                }
 
                part {
-                       name, "part.part.inside.line.left";
+                       name, "part.inside.line.left";
                        type, RECT;
                        scale, 1;
                        description {
@@ -368,7 +367,7 @@ group {
                }
 
                part {
-                       name, "part.part.inside.line.down";
+                       name, "part.inside.line.down";
                        type, RECT;
                        scale, 1;
                        description {
@@ -398,7 +397,7 @@ group {
                }
 
                part {
-                       name, "part.part.inside.line.right";
+                       name, "part.inside.line.right";
                        type, RECT;
                        scale, 1;
                        description {
@@ -554,10 +553,10 @@ group {
                                        set_state(PART:"part.bg", "selected", 0.0);
                                        set_state(PART:"elm.text", "selected", 0.0);
                                        set_state(PART:"part.arrow", "selected", 0.0);
-                                       set_state(PART:"part.part.inside.line.up", "selected", 0.0);
-                                       set_state(PART:"part.part.inside.line.down", "selected", 0.0);
-                                       set_state(PART:"part.part.inside.line.left", "selected", 0.0);
-                                       set_state(PART:"part.part.inside.line.right", "selected", 0.0);
+                                       set_state(PART:"part.inside.line.up", "selected", 0.0);
+                                       set_state(PART:"part.inside.line.down", "selected", 0.0);
+                                       set_state(PART:"part.inside.line.left", "selected", 0.0);
+                                       set_state(PART:"part.inside.line.right", "selected", 0.0);
                                } else {
                                        run_program(PROGRAM:"unfocused,anim");
                                }
@@ -570,10 +569,10 @@ group {
                        target, "part.bg";
                        target, "elm.text";
                        target, "part.arrow";
-                       target, "part.part.inside.line.up";
-                       target, "part.part.inside.line.down";
-                       target, "part.part.inside.line.left";
-                       target, "part.part.inside.line.right";
+                       target, "part.inside.line.up";
+                       target, "part.inside.line.down";
+                       target, "part.inside.line.left";
+                       target, "part.inside.line.right";
                        transition, TRANSITION_FOCUS;
                }
 
@@ -583,10 +582,10 @@ group {
                        target, "part.bg";
                        target, "elm.text";
                        target, "part.arrow";
-                       target, "part.part.inside.line.up";
-                       target, "part.part.inside.line.down";
-                       target, "part.part.inside.line.left";
-                       target, "part.part.inside.line.right";
+                       target, "part.inside.line.up";
+                       target, "part.inside.line.down";
+                       target, "part.inside.line.left";
+                       target, "part.inside.line.right";
                        transition, TRANSITION_FOCUS;
                }
 
@@ -599,10 +598,10 @@ group {
                                set_state(PART:"part.bg", "selected", 0.0);
                                set_state(PART:"elm.text", "selected", 0.0);
                                set_state(PART:"part.arrow", "selected", 0.0);
-                               set_state(PART:"part.part.inside.line.up", "selected", 0.0);
-                               set_state(PART:"part.part.inside.line.down", "selected", 0.0);
-                               set_state(PART:"part.part.inside.line.left", "selected", 0.0);
-                               set_state(PART:"part.part.inside.line.right", "selected", 0.0);
+                               set_state(PART:"part.inside.line.up", "selected", 0.0);
+                               set_state(PART:"part.inside.line.down", "selected", 0.0);
+                               set_state(PART:"part.inside.line.left", "selected", 0.0);
+                               set_state(PART:"part.inside.line.right", "selected", 0.0);
                        }
                }
 
@@ -613,10 +612,10 @@ group {
                        script {
                                set_state(PART:"elm.text", "disable", 0.0);
                                set_state(PART:"part.arrow", "disable", 0.0);
-                               set_state(PART:"part.part.inside.line.up", "disable", 0.0);
-                               set_state(PART:"part.part.inside.line.down", "disable", 0.0);
-                               set_state(PART:"part.part.inside.line.left", "disable", 0.0);
-                               set_state(PART:"part.part.inside.line.right", "disable", 0.0);
+                               set_state(PART:"part.inside.line.up", "disable", 0.0);
+                               set_state(PART:"part.inside.line.down", "disable", 0.0);
+                               set_state(PART:"part.inside.line.left", "disable", 0.0);
+                               set_state(PART:"part.inside.line.right", "disable", 0.0);
                        }
                }
        }
@@ -646,7 +645,7 @@ group {
                }
 
                part {
-                       name, "part.part.inside.line.up";
+                       name, "part.inside.line.up";
                        type, RECT;
                        scale, 1;
                        description {
@@ -664,7 +663,7 @@ group {
                }
 
                part {
-                       name, "part.part.inside.line.left";
+                       name, "part.inside.line.left";
                        type, RECT;
                        scale, 1;
                        description {
@@ -682,7 +681,7 @@ group {
                }
 
                part {
-                       name, "part.part.inside.line.down";
+                       name, "part.inside.line.down";
                        type, RECT;
                        scale, 1;
                        description {
@@ -700,7 +699,7 @@ group {
                }
 
                part {
-                       name, "part.part.inside.line.right";
+                       name, "part.inside.line.right";
                        type, RECT;
                        scale, 1;
                        description {
@@ -779,6 +778,15 @@ group {
                                state, "default" 0.0;
                                min, 0 64;
                        }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               color, 0 119 246 255;
+                       }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                       }
                }
 
                part {
@@ -836,6 +844,16 @@ group {
                                        align, 0.5 0.5;
                                }
                        }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               color, 255 255 255 255;
+                       }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 87 87 87 127;
+                       }
                }
 
                part {
@@ -854,6 +872,11 @@ group {
                                align, 0.5 0.0;
                                fixed, 0 1;
                        }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 194 194 194 127;
+                       }
                }
 
                part {
@@ -875,6 +898,11 @@ group {
                                align, 0.0 0.5;
                                fixed, 1 0;
                        }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 194 194 194 127;
+                       }
                }
 
                part {
@@ -893,6 +921,11 @@ group {
                                align, 0.5 1.0;
                                fixed, 0 1;
                        }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 194 194 194 127;
+                       }
                }
 
                part {
@@ -914,6 +947,46 @@ group {
                                align, 1.0 0.5;
                                fixed, 1 0;
                        }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 194 194 194 127;
+                       }
+               }
+       }
+
+       programs {
+               program {
+                       name, SIG_FOCUSED;
+                       signal, "elm,action,focus";
+                       source, "elm";
+                       action, STATE_SET "focused" 0.0;
+                       target, "part.bg";
+                       target, "elm.text";
+                       transition, TRANSITION_FOCUS;
+               }
+
+               program {
+                       name, SIG_UNFOCUSED;
+                       signal, "elm,action,unfocus";
+                       source, "elm";
+                       action, STATE_SET "default" 0.0;
+                       target, "part.bg";
+                       target, "elm.text";
+                       transition, TRANSITION_FOCUS;
+               }
+
+               program {
+                       name, SIG_DISABLE;
+                       signal, SIG_DISABLE;
+                       source, SRC_LIVETV_BTN;
+                       script {
+                               set_state(PART:"elm.text", "disable", 0.0);
+                               set_state(PART:"part.inside.line.up", "disable", 0.0);
+                               set_state(PART:"part.inside.line.down", "disable", 0.0);
+                               set_state(PART:"part.inside.line.left", "disable", 0.0);
+                               set_state(PART:"part.inside.line.right", "disable", 0.0);
+                       }
                }
        }
 }
@@ -921,6 +994,10 @@ group {
 group {
        name, "elm/button/base/style.action.menu.button";
        data.item, "focus_highlight" "on";
+       script {
+               public cur_state;
+       }
+
        parts {
                part {
                        name, "part.bg";
@@ -930,6 +1007,19 @@ group {
                                state, "default" 0.0;
                                min, 125 124;
                        }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               color, 0 119 246 255;
+                       }
+                       description {
+                               state, "selected" 0.0;
+                               inherit, "default" 0.0;
+                       }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                       }
                }
 
                part {
@@ -1003,8 +1093,8 @@ group {
                }
 
                part {
-                       name, "elm.swallow.content";
-                       type, SWALLOW;
+                       name, "part.icon";
+                       type, IMAGE;
                        scale, 1;
                        description {
                                state, "default" 0.0;
@@ -1020,6 +1110,18 @@ group {
                                fixed, 1 1;
                                min, 60 60;
                        }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                       }
                }
 
                part {
@@ -1060,6 +1162,247 @@ group {
                                        align, 0.5 0.5;
                                }
                        }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               color, 255 255 255 255;
+                       }
+                       description {
+                               state, "selected" 0.0;
+                               inherit, "default" 0.0;
+                               color, 64 136 211 255;
+                       }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 104 104 104 127;
+                       }
+               }
+       }
+
+       programs{
+               program {
+                       name, SIG_FOCUSED;
+                       signal, "elm,action,focus";
+                       source, "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+                               if (state != STATE_DISABLE) {
+                                       set_int(cur_state, STATE_NORMAL);
+                                       run_program(PROGRAM:"focused,anim");
+                               }
+                       }
+               }
+
+               program {
+                       name, SIG_UNFOCUSED;
+                       signal, "elm,action,unfocus";
+                       source, "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+                               if (state == STATE_SELECTED) {
+                                       set_state(PART:"part.bg", "selected", 0.0);
+                                       set_state(PART:"elm.text", "selected", 0.0);
+                                       set_state(PART:"part.icon", "selected", 0.0);
+                               } else if (state != STATE_DISABLE) {
+                                       run_program(PROGRAM:"unfocused,anim");
+                               }
+                       }
+               }
+
+               program {
+                       name, "focused,anim";
+                       action, STATE_SET "focused" 0.0;
+                       target, "part.bg";
+                       target, "elm.text";
+                       target, "part.icon";
+                       transition, TRANSITION_FOCUS;
+               }
+
+               program {
+                       name, "unfocused,anim";
+                       action, STATE_SET "default" 0.0;
+                       target, "part.bg";
+                       target, "elm.text";
+                       target, "part.icon";
+                       transition, TRANSITION_FOCUS;
+               }
+
+               program {
+                       name, SIG_SELECTED;
+                       signal, SIG_SELECTED;
+                       source, SRC_ACTION_BTN;
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+                               if (state != STATE_DISABLE) {
+                                       set_int(cur_state, STATE_SELECTED);
+                                       set_state(PART:"part.bg", "selected", 0.0);
+                                       set_state(PART:"elm.text", "selected", 0.0);
+                                       set_state(PART:"part.icon", "selected", 0.0);
+                               }
+                       }
+               }
+
+               program {
+                       name, SIG_DISABLE;
+                       signal, SIG_DISABLE;
+                       source, SRC_ACTION_BTN;
+                       script {
+                               set_int(cur_state, STATE_DISABLE);
+                               set_state(PART:"part.bg", "disable", 0.0);
+                               set_state(PART:"elm.text", "disable", 0.0);
+                               set_state(PART:"part.icon", "disable", 0.0);
+                       }
+               }
+       }
+}
+
+group {
+       name, "elm/button/base/style.action.menu.favorite.button";
+       inherit, "elm/button/base/style.action.menu.button";
+       data.item, "focus_highlight" "on";
+       images {
+               image, ACTION_FAV_NOR_PNG COMP;
+               image, ACTION_FAV_FOC_PNG COMP;
+               image, ACTION_FAV_SEL_PNG COMP;
+               image, ACTION_FAV_DIS_PNG COMP;
+       }
+       parts {
+               part {
+                       name, "part.icon";
+                       type, IMAGE;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, "part.icon.bg";
+                                       relative, 0.5 0.5;
+                               }
+                               rel2 {
+                                       to, "part.icon.bg";
+                                       relative, 0.5 0.5;
+                               }
+                               align, 0.5 0.5;
+                               fixed, 1 1;
+                               min, 60 60;
+                               image.normal, ACTION_FAV_NOR_PNG;
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               image.normal, ACTION_FAV_FOC_PNG;
+                       }
+                       description {
+                               state, "selected" 0.0;
+                               inherit, "default" 0.0;
+                               image.normal, ACTION_FAV_SEL_PNG;
+                       }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               image.normal, ACTION_FAV_DIS_PNG;
+                       }
+               }
+       }
+}
+
+group {
+       name, "elm/button/base/style.action.menu.lock.button";
+       inherit, "elm/button/base/style.action.menu.button";
+       data.item, "focus_highlight" "on";
+       images {
+               image, ACTION_LOCK_NOR_PNG COMP;
+               image, ACTION_LOCK_FOC_PNG COMP;
+               image, ACTION_LOCK_SEL_PNG COMP;
+               image, ACTION_LOCK_DIS_PNG COMP;
+       }
+       parts {
+               part {
+                       name, "part.icon";
+                       type, IMAGE;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, "part.icon.bg";
+                                       relative, 0.5 0.5;
+                               }
+                               rel2 {
+                                       to, "part.icon.bg";
+                                       relative, 0.5 0.5;
+                               }
+                               align, 0.5 0.5;
+                               fixed, 1 1;
+                               min, 60 60;
+                               image.normal, ACTION_LOCK_NOR_PNG;
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               image.normal, ACTION_LOCK_FOC_PNG;
+                       }
+                       description {
+                               state, "selected" 0.0;
+                               inherit, "default" 0.0;
+                               image.normal, ACTION_LOCK_SEL_PNG;
+                       }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               image.normal, ACTION_LOCK_DIS_PNG;
+                       }
+               }
+       }
+}
+
+group {
+       name, "elm/button/base/style.action.menu.uninstall.button";
+       inherit, "elm/button/base/style.action.menu.button";
+       data.item, "focus_highlight" "on";
+       images {
+               image, ACTION_UNINSTALL_NOR_PNG COMP;
+               image, ACTION_UNINSTALL_FOC_PNG COMP;
+               image, ACTION_UNINSTALL_SEL_PNG COMP;
+               image, ACTION_UNINSTALL_DIS_PNG COMP;
+       }
+       parts {
+               part {
+                       name, "part.icon";
+                       type, IMAGE;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, "part.icon.bg";
+                                       relative, 0.5 0.5;
+                               }
+                               rel2 {
+                                       to, "part.icon.bg";
+                                       relative, 0.5 0.5;
+                               }
+                               align, 0.5 0.5;
+                               fixed, 1 1;
+                               min, 60 60;
+                               image.normal, ACTION_UNINSTALL_NOR_PNG;
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               image.normal, ACTION_UNINSTALL_FOC_PNG;
+                       }
+                       description {
+                               state, "selected" 0.0;
+                               inherit, "default" 0.0;
+                               image.normal, ACTION_UNINSTALL_SEL_PNG;
+                       }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               image.normal, ACTION_UNINSTALL_DIS_PNG;
+                       }
                }
        }
 }
index 04360ca5f9bd28b8acedf248babf78359d306de6..38c3db810883dd121fc21ef0b881e696f47318a9 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <Elementary.h>
 #include <viewmgr.h>
+#include <inputmgr.h>
 #include <app_debug.h>
 
 #include "define.h"
@@ -24,6 +25,7 @@
 struct _priv {
        Evas_Object *win;
        Evas_Object *base;
+       Evas_Object *live_btn;
        Evas_Object *menu_btn[ACTION_MENU_COUNT];
 };
 
@@ -34,14 +36,35 @@ const char *str_action[] = {
        NULL
 };
 
-/* 'Lock' and 'Uninstall' is not supported now, so the disable image is used. */
-const char *str_action_png[] = {
-       ACTION_FAV_NOR_PNG,
-       ACTION_LOCK_DIS_PNG,
-       ACTION_UNINSTALL_DIS_PNG,
+const char *style_action[] = {
+       STYLE_ACTION_MENU_FAV_BTN,
+       STYLE_ACTION_MENU_LOCK_BTN,
+       STYLE_ACTION_MENU_UNINSTALL_BTN,
        NULL
 };
 
+static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj,
+               Evas_Event_Mouse_Move *ev)
+{
+       if (!obj) {
+               _ERR("Invalid argument.");
+               return;
+       }
+
+       if (!elm_object_focus_get(obj))
+               elm_object_focus_set(obj, EINA_TRUE);
+}
+
+static input_handler _livetv_input_handler = {
+       .mouse_move = _mouse_move_cb
+       /* It will be implemented later. */
+};
+
+static input_handler _action_input_handler = {
+       .mouse_move = _mouse_move_cb
+       /* It will be implemented later. */
+};
+
 static bool _draw_top_area(struct _priv *priv)
 {
        Evas_Object *btn;
@@ -58,12 +81,16 @@ static bool _draw_top_area(struct _priv *priv)
                return false;
        }
 
+       inputmgr_add_callback(btn, 0, &_livetv_input_handler, priv);
+
+       priv->live_btn = btn;
+
        return true;
 }
 
 static bool _draw_menu_area(struct _priv *priv)
 {
-       Evas_Object *box, *btn, *img;
+       Evas_Object *box, *btn;
        int i;
 
        if (!priv || !priv->base) {
@@ -79,34 +106,32 @@ static bool _draw_menu_area(struct _priv *priv)
 
        for (i = 0; i < ACTION_MENU_COUNT; i++) {
                btn = utils_add_button(priv->base, NULL, str_action[i],
-                               STYLE_ACTION_MENU_BTN);
+                               style_action[i]);
                if (!btn) {
                        _ERR("Add button failed.");
                        evas_object_del(box);
                        return false;
                }
 
-               img = elm_image_add(btn);
-               if (!img) {
-                       _ERR("elm_image_add failed.");
-                       evas_object_del(box);
-                       return false;
-               }
-
-               elm_image_file_set(img, str_action_png[i], NULL);
-               evas_object_show(img);
+               inputmgr_add_callback(btn, i, &_action_input_handler, priv);
 
-               elm_object_part_content_set(btn, NULL, img);
+               /* 'Lock' and 'Uninstall' is not supported, so emit disable. */
+               if (i != 0)
+                       elm_object_signal_emit(btn,
+                                       SIG_DISABLE, SRC_ACTION_BTN);
 
                elm_box_pack_end(box, btn);
 
                priv->menu_btn[i] = btn;
        }
 
+       /* 'Favorite' can only be focused now. */
+       elm_object_focus_next_object_set(priv->menu_btn[0],
+                       priv->menu_btn[0], ELM_FOCUS_LEFT);
        elm_object_focus_next_object_set(priv->menu_btn[0],
-                       priv->menu_btn[ACTION_MENU_COUNT - 1], ELM_FOCUS_LEFT);
-       elm_object_focus_next_object_set(priv->menu_btn[ACTION_MENU_COUNT - 1],
                        priv->menu_btn[0], ELM_FOCUS_RIGHT);
+       elm_object_focus_next_object_set(priv->live_btn, priv->menu_btn[0],
+                       ELM_FOCUS_DOWN);
 
        return true;
 }
@@ -194,6 +219,8 @@ static void _show(void *data)
 
        if (priv->base)
                evas_object_show(priv->base);
+
+       elm_object_focus_set(priv->live_btn, EINA_TRUE);
 }
 
 static void _hide(void *data)
index 6cc8342e4286d73cdd1340445ed03b76d2201eec..2d3b7a957a1754d11636a85df18c69952e97c13d 100644 (file)
@@ -51,7 +51,6 @@ const char *str_sort[] = {
        STR_Z_TO_A,
 };
 
-
 struct _priv {
        Evas_Object *win;
        Evas_Object *base;