#define VIDEO_COPYRIGHT "Unknown"
-#define MAX_NUM_MENU 4
+#define NUM_MENU_BTN 4
+#define MAX_BTN_COL 4
+
+#define TABLE_PADDING_X 0
+#define TABLE_PADDING_Y 0
enum _object_type {
ACTION_LIVETV_BTN = 0,
Evas_Object *base;
Evas_Object *tv_btn;
- Evas_Object *menu_btn[MAX_NUM_MENU];
+ Evas_Object *menu_btn[NUM_MENU_BTN];
Evas_Object *grid;
Eina_List *favorite_list;
static bool _draw_menu_area(struct _priv *priv)
{
- Evas_Object *box, *btn;
+ Evas_Object *table, *btn;
int i;
+ int col, row;
- box = util_add_box(priv->base);
- if (!box) {
- _ERR("failed to create box object");
+ table = util_add_table(priv->base, TABLE_PADDING_X, TABLE_PADDING_Y);
+ if (!table) {
+ _ERR("failed to add table");
return false;
}
- for (i = 0; i < MAX_NUM_MENU; i++) {
- btn = elm_button_add(box);
+ for (i = 0; i < NUM_MENU_BTN; i++) {
+ btn = elm_button_add(priv->base);
if (!btn) {
_ERR("failed to create button object");
- evas_object_del(box);
+ evas_object_del(table);
return false;
}
elm_object_style_set(btn, menu_info[i].style);
elm_object_text_set(btn, menu_info[i].title);
- if (menu_info[i].disabled) {
- elm_object_signal_emit(btn, SIG_ITEM_DISABLED,
- SIG_SOURCE_SRC);
- elm_object_focus_allow_set(btn, EINA_FALSE);
- }
-
- elm_box_pack_end(box, btn);
+ if (menu_info[i].disabled)
+ elm_object_disabled_set(btn, EINA_TRUE);
evas_object_show(btn);
elm_object_focus_next_object_set(btn, priv->grid,
ELM_FOCUS_DOWN);
+ col = i % MAX_BTN_COL;
+ row = i / MAX_BTN_COL;
+
+ elm_table_pack(table, btn, col, row, 1, 1);
+
priv->menu_btn[i] = btn;
}
- evas_object_show(box);
+ evas_object_show(table);
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[MAX_NUM_MENU - 1],
- priv->menu_btn[MAX_NUM_MENU - 1],
+ elm_object_focus_next_object_set(priv->menu_btn[NUM_MENU_BTN - 1],
+ priv->menu_btn[NUM_MENU_BTN - 1],
ELM_FOCUS_RIGHT);
- elm_object_part_content_set(priv->base, PART_ACTION_MENU_AREA, box);
+ elm_object_part_content_set(priv->base, PART_ACTION_MENU_AREA, table);
return true;
}
inputmgr_remove_callback(priv->tv_btn, &_handler);
inputmgr_remove_callback(priv->grid, &_handler);
- for (i = 0; i < MAX_NUM_MENU; i++)
+ for (i = 0; i < NUM_MENU_BTN; i++)
inputmgr_remove_callback(priv->menu_btn[i], &_handler);
if (priv->favorite_list)