Commit 115197b3 authored by Ludovic Fauvet's avatar Ludovic Fauvet

mini player: fix layout containing very long text

parent 5a1f8583
......@@ -72,10 +72,11 @@ collections
}
part {
name: "swallow.title";
type: SWALLOW;
type: TEXT;
description {
state: "pause" 0.0;
color: 0 0 255 255; // transparent grey
state: "default" 0.0;
color: 0 0 0 255; // black
visible: 1;
rel1 {
relative: 0.2 0.0;
to: "hub_button";
......@@ -88,14 +89,19 @@ collections
to_x: "hub_button";
to_y: "hub_button";
}
text {
text: "title";
size: 22;
ellipsis: 0;
}
}
}
part {
name: "swallow.subtitle";
type: SWALLOW;
type: TEXT;
description {
state: "pause" 0.0;
color: 0 255 0 255; // transparent grey
color: 70 70 70 255; // grey/black
rel1 {
relative: 0.2 0.5;
to: "hub_button";
......@@ -106,6 +112,11 @@ collections
to_x: "hub_button";
to_y: "hub_button";
}
text {
text: "subtitle";
size: 20;
ellipsis: 0;
}
}
}
part {
......
......@@ -42,6 +42,7 @@ struct audio_player {
double slider_event_time;
Evas_Object *layout;
Evas_Object *fs_table, *popup;
Evas_Object *fullscreen_box;
Evas_Object *slider, *fs_slider;
......@@ -364,13 +365,13 @@ update_player_display(audio_player* mpd)
const char *psz_meta = media_item_title(p_mi);
if (psz_meta)
{
elm_object_text_set(mpd->title, psz_meta);
elm_object_part_text_set(mpd->layout, "swallow.title", psz_meta);
elm_object_text_set(mpd->fs_title, psz_meta);
}
psz_meta = media_item_artist(p_mi);
if (psz_meta)
{
elm_object_text_set(mpd->sub_title, psz_meta);
elm_object_part_text_set(mpd->layout, "swallow.subtitle", psz_meta);
elm_object_text_set(mpd->fs_sub_title, psz_meta);
}
}
......@@ -666,16 +667,6 @@ swallow_mini_player(audio_player *mpd, Evas_Object *layout)
mpd->cover = create_icon(layout, "background_cone.png");
elm_object_part_content_set(layout, "swallow.cover", mpd->cover);
/* set the title label */
mpd->title = elm_label_add(layout);
//elm_object_text_set(mpd->title, "<b>Title</b>");
elm_object_part_content_set(layout, "swallow.title", mpd->title);
/* set the sub title label */
mpd->sub_title = elm_label_add(layout);
//elm_object_text_set(mpd->sub_title, "Subtitle");
elm_object_part_content_set(layout, "swallow.subtitle", mpd->sub_title);
/* set the play/pause button */
mpd->play_pause_img = create_icon(layout, "ic_pause_circle_normal_o.png");
elm_object_part_content_set(layout, "swallow.play", mpd->play_pause_img);
......@@ -1037,6 +1028,8 @@ audio_player_create(interface *intf, playback_service *p_ps, Evas_Object *layout
LOGE("Unable to register the audio player");
swallow_mini_player(mpd, layout);
mpd->layout = layout;
/* Add button callbacks */
evas_object_event_callback_add(mpd->play_pause_img, EVAS_CALLBACK_MOUSE_DOWN, play_pause_mouse_down_cb, mpd);
......
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