}
}
part {
+ name: "padding_title_left";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.to: "bg";
+ rel2 {
+ to: "bg";
+ relative: 0.0 1.0;
+ }
+ min: 14 0;
+ align: 0.0 0.5;
+ fixed: 1 0;
+ }
+ }
+ part {
+ name: "padding_title_right";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "bg";
+ relative: 1.0 0.0;
+ }
+ rel2.to: "bg";
+ min: 14 0;
+ align: 1.0 0.5;
+ fixed: 1 0;
+ }
+ }
+ part {
name: PART_ELM_TEXT_TITLE;
type: TEXT;
scale: 1;
description {
state: "default" 0.0;
rel1 {
- to: "bg";
- relative: 0.5 0.5;
+ to: "padding_title_left";
+ relative: 1.0 0.5;
}
rel2 {
- to: "bg";
- relative: 0.5 0.5;
+ to: "padding_title_right";
+ relative: 0.0 0.5;
}
text {
font: FONT_LIGHT;
size: 28;
- min: 1 0;
align: 0.5 0.5;
- ellipsis: -1;
}
min: 0 28;
align: 0.5 0.5;
viewmgr_push_view(VIEW_DETAIL);
}
+static void _genre_selected_cb(void *data, Elm_Object_Item *it)
+{
+ struct view_update_data vdata;
+ struct group_info *gi;
+
+ if (!it) {
+ _ERR("invalid argument");
+ return;
+ }
+
+ gi = elm_object_item_data_get(it);
+ if (!gi) {
+ _ERR("failed to get group info");
+ return;
+ }
+
+ vdata.list = gi->list;
+ vdata.index = E_DETAIL_MUSIC_GENRE;
+ vdata.id = gi->name;
+
+ viewmgr_update_view(VIEW_DETAIL, UPDATE_CONTENT, &vdata);
+ viewmgr_push_view(VIEW_DETAIL);
+}
+
static struct grid_class _gclass[] = {
[E_MUSIC_SONG] = {
.item_style = STYLE_MUSIC_SONG,
.gclass = &_gclass[E_MUSIC_GENRE],
.get_item_list = _get_genre_list,
.free_item_list = _free_group_list,
+ .selected_cb = _genre_selected_cb,
},
/* Other view mode data will be added later */
};
.selected = _album_selected,
.detail_update = EINA_TRUE,
},
+ [E_DETAIL_MUSIC_GENRE] = {
+ .grid_style = STYLE_MUSIC_SONG_DETAIL,
+ .grid_item_x = MUSIC_SONG_ITEM_X,
+ .grid_item_y = MUSIC_SONG_ITEM_Y,
+ .get_grid_text = _grid_text_get,
+ .get_grid_content = _grid_content_get,
+ .get_content_info = _get_song_count,
+ .detail_update = EINA_FALSE,
+ },
};
struct _priv {
vdata.list = priv->media_list;
vdata.index = util_get_media_index(vdata.list, am);
- if (priv->view_type == E_DETAIL_MOVIE_GENRE) {
+ switch (priv->view_type) {
+ case E_DETAIL_MOVIE_GENRE:
viewmgr_update_view(VIEW_VIEWER, UPDATE_CONTENT, &vdata);
viewmgr_push_view(VIEW_VIEWER);
- } else if (priv->view_type == E_DETAIL_MUSIC_ALBUM) {
+ break;
+ case E_DETAIL_MUSIC_ALBUM:
+ case E_DETAIL_MUSIC_GENRE:
viewmgr_update_view(VIEW_MPLAYER, UPDATE_CONTENT, &vdata);
viewmgr_push_view(VIEW_MPLAYER);
+ break;
+ default:
+ break;
}
}