disclistbox: Simplify code

Instead of using the GtkListBox's specific ::insert(), use
the add() function from GtkContainer.

This will simplify the transition from GtkListBox to GtkBox
in the future.
parent 504305de
......@@ -285,7 +285,7 @@ class AlbumWidget(Gtk.EventBox):
discs[disc_nr].append(track)
for disc_nr in discs:
disc = self._create_disc_box(disc_nr, discs[disc_nr])
self._disc_listbox.insert(disc, -1)
self._disc_listbox.add(disc)
if len(discs) == 1:
disc.show_disc_label(False)
......
......@@ -444,9 +444,9 @@ class DiscListBox(Gtk.ListBox):
self._selected_items = []
@log
def insert(self, widget, position):
def add(self, widget):
"""Insert a DiscBox widget"""
super().insert(widget, position)
super().add(widget)
widget.connect('selection-changed', self._on_selection_changed)
@log
......
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