Commit 354bd5b5 authored by Ludovic Fauvet's avatar Ludovic Fauvet

mini player: simplifications

parent 9a2203dd
......@@ -70,14 +70,14 @@ collections
}
}
part {
name: "swallow.title";
name: "title_text";
type: TEXT;
description {
color: 0 0 0 255; // black
visible: 1;
rel1 {
relative: 1.2 0.0;
to: "swallow.cover";
relative: 1.1 0.0;
to: "cover";
}
rel2 {
relative: 0.0 0.5;
......@@ -92,13 +92,13 @@ collections
}
}
part {
name: "swallow.subtitle";
name: "subtitle_text";
type: TEXT;
description {
color: 70 70 70 255; // grey/black
rel1 {
relative: 1.2 0.5;
to: "swallow.cover";
relative: 1.1 0.5;
to: "cover";
}
rel2 {
relative: 0.0 1.0;
......@@ -113,7 +113,7 @@ collections
}
}
part {
name: "swallow.cover";
name: "cover";
type: SWALLOW;
description {
aspect: 1.0 1.0;
......@@ -142,7 +142,7 @@ collections
to: "hub_background";
}
rel2 {
relative: 0.0 1.0;
relative: 0.0 1.1;
to: "swallow.previous";
}
}
......
......@@ -647,33 +647,38 @@ update_player_play_pause(audio_player* mpd)
static void
update_player_title_display(audio_player* mpd, const char *title)
{
elm_object_part_text_set(mpd->layout, "swallow.title", title);
elm_object_part_text_set(mpd->layout, "title_text", title);
elm_object_part_text_set(mpd->fs_layout, "title_text", title);
}
static void
update_player_artist_display(audio_player* mpd, const char *artist)
{
elm_object_part_text_set(mpd->layout, "swallow.subtitle", artist);
elm_object_part_text_set(mpd->layout, "subtitle_text", artist);
elm_object_part_text_set(mpd->fs_layout, "subtitle_text", artist);
}
static void
update_player_cover_display(audio_player* mpd, const char *path)
{
evas_object_del(elm_object_part_content_get(mpd->layout, "swallow.cover"));
evas_object_del(elm_object_part_content_get(mpd->fs_layout, "cover"));
Evas_Object *cover, *fs_cover;
evas_object_del(elm_object_part_content_unset(mpd->layout, "cover"));
evas_object_del(elm_object_part_content_unset(mpd->fs_layout, "cover"));
if (path)
{
elm_object_part_content_set(mpd->layout, "swallow.cover", create_image(mpd->layout, path));
elm_object_part_content_set(mpd->fs_layout, "cover", create_image(mpd->fs_layout, path));
cover = create_image(mpd->layout, path);
fs_cover = create_image(mpd->fs_layout, path);
}
else
{
elm_object_part_content_set(mpd->layout, "swallow.cover", create_icon(mpd->layout, "background_cone.png"));
elm_object_part_content_set(mpd->fs_layout, "cover", create_icon(mpd->fs_layout, "background_cone.png"));
cover = create_icon(mpd->layout, "background_cone.png");
fs_cover = create_icon(mpd->fs_layout, "background_cone.png");
}
elm_object_part_content_set(mpd->layout, "cover", cover);
elm_object_part_content_set(mpd->fs_layout, "cover", fs_cover);
}
static void
......@@ -1007,7 +1012,7 @@ swallow_mini_player(audio_player *mpd, Evas_Object *layout)
/* set the cover image */
Evas_Object *placeholder = create_icon(layout, "background_cone.png");
elm_object_part_content_set(layout, "swallow.cover", placeholder);
elm_object_part_content_set(layout, "cover", placeholder);
/* set the play/pause button */
mpd->play_pause_img = create_icon(layout, "ic_pause_circle_normal_o.png");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment