Commit 7e34c752 authored by Erik Reider's avatar Erik Reider

Hide MPRIS Carousel dots when one or less player is visible

parent 99d7d9df
......@@ -95,7 +95,8 @@ namespace SwayNotificationCenter.Widgets.Mpris {
carousel_dots = new Adw.CarouselIndicatorDots ();
carousel_dots.set_carousel (carousel);
carousel_dots.show ();
carousel_dots.set_halign (Gtk.Align.CENTER);
carousel_dots.set_valign (Gtk.Align.CENTER);
append (carousel_dots);
// Config
......@@ -204,11 +205,13 @@ namespace SwayNotificationCenter.Widgets.Mpris {
if (carousel.n_pages > 1) {
button_prev.show ();
button_next.show ();
carousel_dots.set_visible (true);
// Scroll to the new player
carousel.scroll_to (player, false);
}
if (!visible) show ();
if (!visible) show ();
}
private void add_player (string name, MprisSource source) {
......@@ -242,6 +245,7 @@ namespace SwayNotificationCenter.Widgets.Mpris {
if (children_length <= 1) {
button_prev.hide ();
button_next.hide ();
carousel_dots.set_visible (false);
}
}
......
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