Commit 7787d37b authored by Ludovic Fauvet's avatar Ludovic Fauvet

notification: automatically hide next/prev buttons

parent 1b975f91
...@@ -110,6 +110,11 @@ collections { ...@@ -110,6 +110,11 @@ collections {
to: "swallow.play"; to: "swallow.play";
} }
} }
description {
state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
} }
part { part {
name: "swallow.play"; name: "swallow.play";
...@@ -147,13 +152,49 @@ collections { ...@@ -147,13 +152,49 @@ collections {
to: "swallow.play"; to: "swallow.play";
} }
} }
description {
state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
} }
} //parts } //parts
programs {
program { program {
name: "mouse_click"; name: "mouse_click";
signal: "mouse,clicked,1"; signal: "mouse,clicked,1";
source: "hub_background"; source: "hub_background";
action: SIGNAL_EMIT "hub_background,clicked" ""; action: SIGNAL_EMIT "hub_background,clicked" "";
} }
program {
name: "swallow.previous,hide";
signal: "swallow.previous,hide";
source: "";
action: STATE_SET "hidden" 0.0;
target: "swallow.previous";
}
program {
name: "swallow.previous,show";
signal: "swallow.previous,show";
source: "";
action: STATE_SET "default" 0.0;
target: "swallow.previous";
}
program {
name: "swallow.next,hide";
signal: "swallow.next,hide";
source: "";
action: STATE_SET "hidden" 0.0;
target: "swallow.next";
}
program {
name: "swallow.next,show";
signal: "swallow.next,show";
source: "";
action: STATE_SET "default" 0.0;
target: "swallow.next";
}
}
} }
} }
...@@ -142,6 +142,7 @@ ps_notification_update_meta(playback_service *p_ps, media_item *p_mi) ...@@ -142,6 +142,7 @@ ps_notification_update_meta(playback_service *p_ps, media_item *p_mi)
mini_control_title_set(p_ps->p_minicontrol, psz_meta_filename); mini_control_title_set(p_ps->p_minicontrol, psz_meta_filename);
mini_control_cover_set(p_ps->p_minicontrol, p_mi->psz_snapshot); mini_control_cover_set(p_ps->p_minicontrol, p_mi->psz_snapshot);
mini_control_update_next_prev(p_ps->p_minicontrol, p_ps);
} }
static void static void
......
...@@ -48,6 +48,22 @@ struct minicontrol ...@@ -48,6 +48,22 @@ struct minicontrol
struct timeval button_last_event; struct timeval button_last_event;
}; };
void
mini_control_update_next_prev(minicontrol *p_minicontrol, playback_service *p_ps)
{
Evas_Object *edje = elm_layout_edje_get(p_minicontrol->layout);
if (playback_service_has_next(p_ps))
edje_object_signal_emit(edje, "swallow.next,show", "");
else
edje_object_signal_emit(edje, "swallow.next,hide", "");
if (playback_service_has_prev(p_ps))
edje_object_signal_emit(edje, "swallow.previous,show", "");
else
edje_object_signal_emit(edje, "swallow.previous,hide", "");
}
void void
mini_control_visibility_set(minicontrol *mc, Eina_Bool visible) mini_control_visibility_set(minicontrol *mc, Eina_Bool visible)
{ {
......
...@@ -53,4 +53,7 @@ mini_control_progress_set(minicontrol *mc, double progress); ...@@ -53,4 +53,7 @@ mini_control_progress_set(minicontrol *mc, double progress);
void void
mini_control_cover_set(minicontrol *mc, const char* path); mini_control_cover_set(minicontrol *mc, const char* path);
void
mini_control_update_next_prev(minicontrol *p_minicontrol, playback_service *p_ps);
#endif /* MINICONTROL_VIEW_H_ */ #endif /* MINICONTROL_VIEW_H_ */
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