}
group {
- name, "elm/button/base/style.action.menu.button";
+ name, "elm/button/base/style.action.menu.favorite.button";
data.item, "focus_highlight" "on";
script {
public cur_state;
}
+ 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.bg";
scale, 1;
description {
state, "default" 0.0;
+ image.normal, ACTION_FAV_NOR_PNG;
rel1 {
to, "part.icon.bg";
relative, 0.5 0.5;
description {
state, "focused" 0.0;
inherit, "default" 0.0;
+ image.normal, ACTION_FAV_FOC_PNG;
}
description {
- state, "focused" 0.0;
+ state, "selected" 0.0;
inherit, "default" 0.0;
+ image.normal, ACTION_FAV_SEL_PNG;
}
description {
- state, "focused" 0.0;
+ state, "disable" 0.0;
inherit, "default" 0.0;
+ image.normal, ACTION_FAV_DIS_PNG;
}
}
}
program {
- name, SIG_DISABLE;
- signal, SIG_DISABLE;
- source, SRC_ACTION_BTN;
+ name, SIG_BTN_DISABLE;
+ signal, SIG_BTN_DISABLE;
+ source, "elm";
script {
set_int(cur_state, STATE_DISABLE);
set_state(PART:"part.bg", "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";
+ inherit, "elm/button/base/style.action.menu.favorite.button";
data.item, "focus_highlight" "on";
images {
image, ACTION_LOCK_NOR_PNG COMP;
group {
name, "elm/button/base/style.action.menu.share.button";
- inherit, "elm/button/base/style.action.menu.button";
+ inherit, "elm/button/base/style.action.menu.favorite.button";
data.item, "focus_highlight" "on";
images {
image, ACTION_SHARE_NOR_PNG COMP;
Evas_Object *menu_btn[COUNT_ACTION];
};
-const char *str_action[] = {
- STR_FAVORITE,
- STR_LOCK,
- STR_SHARE,
- NULL
+struct _action_info {
+ const char *title;
+ const char *style;
+ Eina_Bool disable;
};
-const char *style_action[] = {
- STYLE_ACTION_MENU_FAV_BTN,
- STYLE_ACTION_MENU_LOCK_BTN,
- STYLE_ACTION_MENU_SHARE_BTN,
- NULL
+static struct _action_info action_info[] = {
+ {
+ .title = STR_FAVORITE,
+ .style = STYLE_ACTION_MENU_FAV_BTN,
+ .disable = EINA_FALSE
+ },
+ {
+ .title = STR_LOCK,
+ .style = STYLE_ACTION_MENU_LOCK_BTN,
+ .disable = EINA_TRUE
+ },
+ {
+ .title = STR_SHARE,
+ .style = STYLE_ACTION_MENU_SHARE_BTN,
+ .disable = EINA_TRUE
+ }
};
static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj,
elm_object_focus_set(obj, EINA_TRUE);
}
+static void _livetv_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
+ Evas_Event_Key_Down *ev)
+{
+ if (!ev) {
+ _ERR("Invalid argument.");
+ return;
+ }
+
+ if (!strcmp(ev->keyname, KEY_BACK)
+ || !strcmp(ev->keyname, KEY_BACK_REMOTE))
+ viewmgr_hide_view(VIEW_ID_ACTION_MENU);
+}
+
+static void _action_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
+ Evas_Event_Key_Down *ev)
+{
+ if (!ev) {
+ _ERR("Invalid argument.");
+ return;
+ }
+
+ if (!strcmp(ev->keyname, KEY_BACK)
+ || !strcmp(ev->keyname, KEY_BACK_REMOTE))
+ viewmgr_hide_view(VIEW_ID_ACTION_MENU);
+}
+
static input_handler _livetv_input_handler = {
- .mouse_move = _mouse_move_cb
- /* It will be implemented later. */
+ .mouse_move = _mouse_move_cb,
+ .key_down = _livetv_key_down_cb
};
static input_handler _action_input_handler = {
- .mouse_move = _mouse_move_cb
- /* It will be implemented later. */
+ .mouse_move = _mouse_move_cb,
+ .key_down = _action_key_down_cb
};
-static bool _draw_top_area(struct _priv *priv)
+static bool _draw_livetv_area(struct _priv *priv)
{
Evas_Object *btn;
inputmgr_add_callback(btn, 0, &_livetv_input_handler, priv);
+ elm_object_focus_next_object_set(btn, btn, ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(btn, btn, ELM_FOCUS_LEFT);
+ elm_object_focus_next_object_set(btn, btn, ELM_FOCUS_RIGHT);
+
priv->live_btn = btn;
return true;
static bool _draw_menu_area(struct _priv *priv)
{
- Evas_Object *box, *btn;
- int i;
+ Evas_Object *table, *btn;
+ int i, row = 0, col = 0;
if (!priv || !priv->base) {
_ERR("Invalid argument.");
return false;
}
- box = utils_add_box(priv->base, PART_ACTION_MENU, EINA_TRUE, 0, 0);
- if (!box) {
- _ERR("Add box failed.");
+ table = utils_add_table(priv->base, PART_ACTION_MENU,
+ SIZE_ACTION_TABLE_BORDER, SIZE_ACTION_TABLE_BORDER);
+ if (!table) {
+ _ERR("Add table failed.");
return false;
}
for (i = 0; i < COUNT_ACTION; i++) {
- btn = utils_add_button(priv->base, NULL, str_action[i],
- style_action[i]);
+ btn = utils_add_button(priv->base, NULL, action_info[i].title,
+ action_info[i].style);
if (!btn) {
_ERR("Add button failed.");
- evas_object_del(box);
+ evas_object_del(table);
return false;
}
inputmgr_add_callback(btn, i, &_action_input_handler, priv);
- /* 'Lock' and 'Share' is not supported, so emit disable. */
- if (i != 0)
- elm_object_signal_emit(btn,
- SIG_DISABLE, SRC_ACTION_BTN);
+ if (action_info[i].disable)
+ elm_object_disabled_set(btn, EINA_TRUE);
+
+ col = i % SIZE_COL_MAX;
+ row = i / SIZE_COL_MAX;
- elm_box_pack_end(box, btn);
+ elm_table_pack(table, btn, col, row, 1, 1);
priv->menu_btn[i] = btn;
}
return true;
}
-static bool _draw_bottom_area(struct _priv *priv)
+static bool _draw_favorite_area(struct _priv *priv)
{
if (!priv || !priv->base) {
_ERR("Invalid argument.");
return;
}
- if (!_draw_top_area(priv)) {
- _ERR("Draw top area failed.");
+ if (!_draw_livetv_area(priv)) {
+ _ERR("Draw livetv area failed.");
return;
}
return;
}
- if (!_draw_bottom_area(priv))
- _ERR("Draw bottom area failed.");
+ if (!_draw_favorite_area(priv))
+ _ERR("Draw favorite area failed.");
}
static Evas_Object *_create(Evas_Object *win, void *data)