Commit 205166f4 authored by Felix Häcker's avatar Felix Häcker

Don't re-add player widget if it is already added. Fixes #400

parent 6a774587
Pipeline #131471 passed with stages
in 8 minutes and 58 seconds
......@@ -118,11 +118,14 @@ impl Player {
}
pub fn show(&self, leaflet: libhandy::Leaflet) {
let separator = gtk::Separator::new(gtk::Orientation::Vertical);
separator.set_visible(true);
leaflet.add(&separator);
// We don't have to add the widget again if it's already added
if leaflet.get_children().len() != 3 {
let separator = gtk::Separator::new(gtk::Orientation::Vertical);
separator.set_visible(true);
leaflet.add(&separator);
leaflet.add(&self.widget);
leaflet.add(&self.widget);
}
leaflet.set_child_name(&self.widget, Some("player"));
// Show a animation using a Gtk.Revealer. We need to add a timeout here,
......
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