tracklist: Give the Top Box the "toolbar" style class
And adjust widget spacing for to keep our nice look. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
eb6b4d8ef4
commit
3d6350d7bd
|
@ -21,11 +21,10 @@ class Card(Gtk.Box):
|
|||
def __init__(self, sql: db.Connection, **kwargs):
|
||||
"""Set up the Tracklist widget."""
|
||||
super().__init__(sql=sql, orientation=Gtk.Orientation.VERTICAL,
|
||||
spacing=6, **kwargs)
|
||||
**kwargs)
|
||||
self._top_left = Gtk.Box()
|
||||
self._top_right = Gtk.Box(sensitive=False)
|
||||
self._top_box = Gtk.CenterBox(margin_top=6, margin_start=6,
|
||||
margin_end=6)
|
||||
self._top_box = Gtk.CenterBox(margin_start=6, margin_end=6)
|
||||
self._filter = entry.Filter("tracks", hexpand=True,
|
||||
margin_start=100, margin_end=100)
|
||||
self._trackview = trackview.TrackView(sql, margin_start=6,
|
||||
|
@ -37,7 +36,7 @@ class Card(Gtk.Box):
|
|||
self._shuffle = buttons.ShuffleButton()
|
||||
self._sort = buttons.SortButton()
|
||||
self._footer = footer.Footer(margin_start=6, margin_end=6,
|
||||
margin_bottom=6)
|
||||
margin_top=6, margin_bottom=6)
|
||||
|
||||
self._top_left.append(self._visible_cols)
|
||||
self._top_left.append(self._unselect)
|
||||
|
@ -67,6 +66,7 @@ class Card(Gtk.Box):
|
|||
self._shuffle.connect("notify::active", self.__update_shuffle_state)
|
||||
self._sort.connect("notify::sort-order", self.__update_sort_order)
|
||||
|
||||
self._top_box.add_css_class("toolbar")
|
||||
self.add_css_class("card")
|
||||
|
||||
def __clear_selection(self, unselect: Gtk.Button) -> None:
|
||||
|
|
|
@ -27,11 +27,9 @@ class TestTracklist(tests.util.TestCase):
|
|||
self.assertIsInstance(self.tracklist._top_right, Gtk.Box)
|
||||
|
||||
self.assertEqual(self.tracklist.sql, self.sql)
|
||||
self.assertEqual(self.tracklist.get_spacing(), 6)
|
||||
self.assertEqual(self.tracklist.get_orientation(),
|
||||
Gtk.Orientation.VERTICAL)
|
||||
|
||||
self.assertEqual(self.tracklist._top_box.get_margin_top(), 6)
|
||||
self.assertEqual(self.tracklist._top_box.get_margin_start(), 6)
|
||||
self.assertEqual(self.tracklist._top_box.get_margin_end(), 6)
|
||||
self.assertEqual(self.tracklist._top_box.get_orientation(),
|
||||
|
@ -44,6 +42,7 @@ class TestTracklist(tests.util.TestCase):
|
|||
self.assertEqual(self.tracklist._top_box.get_end_widget(),
|
||||
self.tracklist._top_right)
|
||||
|
||||
self.assertTrue(self.tracklist._top_box.has_css_class("toolbar"))
|
||||
self.assertTrue(self.tracklist.has_css_class("card"))
|
||||
|
||||
def test_visible_columns(self):
|
||||
|
@ -175,6 +174,7 @@ class TestTracklist(tests.util.TestCase):
|
|||
emmental.tracklist.footer.Footer)
|
||||
self.assertEqual(self.tracklist._footer.get_margin_start(), 6)
|
||||
self.assertEqual(self.tracklist._footer.get_margin_end(), 6)
|
||||
self.assertEqual(self.tracklist._footer.get_margin_top(), 6)
|
||||
self.assertEqual(self.tracklist._footer.get_margin_bottom(), 6)
|
||||
self.assertEqual(self.tracklist._trackview.get_next_sibling(),
|
||||
self.tracklist._footer)
|
||||
|
|
Loading…
Reference in New Issue