relative: 1.0 1.0;
}
rel2.to: PART_ACTION_MENU_AREA;
- min: 10 40;
+ min: 30 40;
align: 1.0 0.0;
fixed: 1 1;
}
}
}
part {
- name: "padding_favorite_area";
+ name: "padding_favorite_area_left_top";
type: SPACER;
scale: 1;
description {
to: PART_ACTION_FAVORITE_TITLE;
relative: 0.0 1.0;
}
- rel2.to: PART_ACTION_FAVORITE_TITLE;
+ rel2 {
+ to: PART_ACTION_FAVORITE_TITLE;
+ relative: 0.0 1.0;
+ }
min: 0 30;
- align: 0.5 0.0;
- fixed: 0 1;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "padding_favorite_area_right_bottom";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.relative: 1.0 1.0;
+ rel2.relative: 1.0 1.0;
+ min: 10 0;
+ align: 1.0 1.0;
+ fixed: 1 1;
}
}
part {
description {
state: "default" 0.0;
rel1 {
- to: "padding_favorite_area";
+ to: "padding_favorite_area_left_top";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "padding_favorite_area_right_bottom";
+ relative: 0.0 0.0;
+ }
+ }
+ }
+ part {
+ name: "padding_bg_no_content_right_bottom";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.relative: 1.0 1.0;
+ rel2.relative: 1.0 1.0;
+ min: 30 32;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: PART_ACTION_NO_CONTENT_BG;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "padding_favorite_area_left_top";
relative: 0.0 1.0;
}
rel2 {
- to_x: "padding_favorite_area";
- to_y: "bg";
+ to: "padding_bg_no_content_right_bottom";
+ relative: 0.0 0.0;
+ }
+ }
+ }
+ }
+}
+
+group {
+ name: GRP_ACTION_NO_CONTENT;
+ parts {
+ part {
+ name: PART_NO_CONTENT_BG;
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: COLOR_NO_CONTENT_BG;
+ visible: 0;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ part {
+ name: PART_NO_CONTENT_TEXT;
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ text {
+ font: FONT_LIGHT;
+ size: 32;
+ align: 0.5 0.5;
}
+ color: COLOR_TEXT_INDEX;
+ visible: 0;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
}
}
}
+ programs {
+ program {
+ name: SIG_SHOW_NO_CONTENT;
+ signal: SIG_SHOW_NO_CONTENT;
+ source: SIG_SOURCE_SRC;
+ action: STATE_SET "show" 0.0;
+ target: PART_NO_CONTENT_BG;
+ target: PART_NO_CONTENT_TEXT;
+ }
+ program {
+ name: SIG_HIDE_NO_CONTENT;
+ signal: SIG_HIDE_NO_CONTENT;
+ source: SIG_SOURCE_SRC;
+ action: STATE_SET "default" 0.0;
+ target: PART_NO_CONTENT_BG;
+ target: PART_NO_CONTENT_TEXT;
+ }
+ }
}
Evas_Object *menu_btn[NUM_MENU_BTN];
Evas_Object *table;
+ Evas_Object *ly;
Evas_Object *grid;
Elm_Object_Item *selected_it;
const char *style;
int app_contents_type;
+
+ const char *no_content;
};
static struct _menu_info menu_info[] = {
.grid_x = GRID_ITEM_X_MOVIE,
.grid_y = GRID_ITEM_Y_MOVIE,
.style = STYLE_GRID_MOVIE_ITEM_FAVORITE,
- .app_contents_type = CONTENTS_MOVIE
+ .app_contents_type = CONTENTS_MOVIE,
+ .no_content = "No favorite Movies"
},
{
.grid_x = GRID_ITEM_X_GALLERY,
.grid_y = GRID_ITEM_Y_GALLERY,
.style = STYLE_GRID_GALLERY_ITEM_FAVORITE,
- .app_contents_type = CONTENTS_GALLERY
+ .app_contents_type = CONTENTS_GALLERY,
+ .no_content = "No favorite Contents"
},
{
.grid_x = GRID_ITEM_X_MUSIC,
.grid_y = GRID_ITEM_Y_MUSIC,
.style = STYLE_GRID_SONG_ITEM_FAVORITE,
- .app_contents_type = CONTENTS_MUSIC
+ .app_contents_type = CONTENTS_MUSIC,
+ .no_content = "No favorite Songs"
}
};
static bool _draw_favorite_area(struct _priv *priv)
{
- Evas_Object *grid;
+ Evas_Object *ly, *grid;
elm_object_part_text_set(priv->base, PART_ACTION_FAVORITE_TITLE,
TEXT_FAVORITE);
+ ly = elm_layout_add(priv->base);
+ if (!ly) {
+ _ERR("failed to create layout object");
+ return false;
+ }
+
+ elm_layout_file_set(ly, EDJEFILE, GRP_ACTION_NO_CONTENT);
+
+ elm_object_part_content_set(priv->base, PART_ACTION_NO_CONTENT_BG, ly);
+
grid = util_add_gengrid(priv->base, 0, 0, EINA_FALSE);
if (!grid) {
_ERR("failed to create gengrid object");
+ evas_object_del(ly);
return false;
}
elm_object_part_content_set(priv->base,
PART_ACTION_FAVORITE_AREA, grid);
+ priv->ly = ly;
priv->grid = grid;
return true;
ELM_FOCUS_RIGHT);
}
+static void _update_no_content_area(struct _priv *priv)
+{
+ if (!priv->favorite_list) {
+ elm_object_signal_emit(priv->ly, SIG_SHOW_NO_CONTENT,
+ SIG_SOURCE_SRC);
+ elm_object_part_text_set(priv->ly, PART_NO_CONTENT_TEXT,
+ content_info[priv->content_type].
+ no_content);
+
+ elm_object_focus_allow_set(priv->grid, EINA_FALSE);
+ } else {
+ elm_object_signal_emit(priv->ly, SIG_HIDE_NO_CONTENT,
+ SIG_SOURCE_SRC);
+
+ elm_object_focus_allow_set(priv->grid, EINA_TRUE);
+ }
+}
+
static void _update_favorite_area(struct _priv *priv)
{
Elm_Gengrid_Item_Class *ic;
Elm_Object_Item *it;
- Eina_List *favorite_l, *l;
+ Eina_List *l;
app_media *am;
int type;
type = priv->content_type;
+ if (priv->favorite_list)
+ _free_favorite_list(priv->favorite_list);
+
+ priv->favorite_list = _get_favorite_list(
+ content_info[type].app_contents_type);
+
elm_gengrid_item_size_set(priv->grid,
elm_config_scale_get() * content_info[type].grid_x,
elm_config_scale_get() * content_info[type].grid_y);
ic = _get_grid_item_class(type);
- favorite_l = _get_favorite_list(content_info[type].app_contents_type);
-
- EINA_LIST_FOREACH(favorite_l, l, am) {
+ EINA_LIST_FOREACH(priv->favorite_list, l, am) {
it = elm_gengrid_item_append(priv->grid, ic, am, NULL, NULL);
elm_object_item_data_set(it, am);
elm_gengrid_item_class_free(ic);
- priv->favorite_list = favorite_l;
+ _update_no_content_area(priv);
}
static bool _draw_items(struct _priv *priv)