Commit 32ec7403 authored by Georges Basile Stavracas Neto's avatar Georges Basile Stavracas Neto Committed by Marinus Schraal

disclistboxwidget: Turn into a GtkBox subclass

The current disc list implementation uses a GtkListBox as
the parent class. This brings some issues with it, as the
listbox widget has selectable, focusable rows that break
the keyboard navigation. The listbox rows also handle clicks
and add a strange effect to the disc list when clicking
outside the songs list.

Fix this by using GtkBox as the base class of DiscListBox,
and the keyboard and clicking issues are all gone. Remove a css
workaround as well.

https://bugzilla.gnome.org/show_bug.cgi?id=775929
parent d87d352f
......@@ -79,7 +79,6 @@
<object class="DiscListBox" id="disclistbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
</object>
<packing>
<property name="expand">False</property>
......
......@@ -11,11 +11,6 @@ flowbox, treeview, widget {
-gtk-key-bindings: unbind-ctrl-space;
}
/* Workaround the black border bug (#773459). */
list, row {
background: transparent;
}
.discsongsflowbox > flowboxchild {
padding: 0px;
}
......
......@@ -422,7 +422,7 @@ class DiscBox(Gtk.Box):
return True
class DiscListBox(Gtk.ListBox):
class DiscListBox(Gtk.Box):
"""A ListBox widget containing all discs of a particular
album
"""
......@@ -438,8 +438,7 @@ class DiscListBox(Gtk.ListBox):
@log
def __init__(self):
"""Initialize"""
super().__init__()
super().set_selection_mode(Gtk.SelectionMode.NONE)
super().__init__(orientation=Gtk.Orientation.VERTICAL)
self._selection_mode = False
self._selection_mode_allowed = False
......@@ -465,7 +464,7 @@ class DiscListBox(Gtk.ListBox):
self._selected_items = []
def get_child_selected_items(child):
self._selected_items += child.get_child().get_selected_items()
self._selected_items += child.get_selected_items()
self.foreach(get_child_selected_items)
......@@ -499,7 +498,7 @@ class DiscListBox(Gtk.ListBox):
self._selection_mode = selection_mode
def set_child_selection_mode(child):
child.get_child().set_selection_mode(self._selection_mode)
child.set_selection_mode(self._selection_mode)
self.foreach(set_child_selection_mode)
......
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