sidebar: Create a Stack Switcher
This allocates a Stack during __init__(), which can then be displayed to the user. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
16038a16f1
commit
7beebbc7d1
|
@ -35,3 +35,12 @@ class Stack(Gtk.Stack):
|
|||
|
||||
@GObject.Signal(arg_types=(db.playlist.Playlist,))
|
||||
def playlist_changed(self, plist): pass
|
||||
|
||||
|
||||
class Switcher(Gtk.StackSwitcher):
|
||||
def __init__(self):
|
||||
Gtk.StackSwitcher.__init__(self)
|
||||
self.add_css_class("large-icons")
|
||||
self.add_css_class("osd")
|
||||
self.set_orientation(Gtk.Orientation.VERTICAL)
|
||||
self.set_stack(Stack())
|
||||
|
|
|
@ -73,3 +73,13 @@ class TestStack(unittest.TestCase):
|
|||
self.assertEqual(self.changed, g2)
|
||||
child.get_selection().set_selected(0)
|
||||
self.assertEqual(self.changed, g1)
|
||||
|
||||
|
||||
class TestSwitcher(unittest.TestCase):
|
||||
def test_init(self):
|
||||
switcher = stack.Switcher()
|
||||
self.assertIsInstance(switcher, Gtk.StackSwitcher)
|
||||
self.assertIsInstance(switcher.get_stack(), stack.Stack)
|
||||
self.assertEqual(switcher.get_orientation(), Gtk.Orientation.VERTICAL)
|
||||
self.assertTrue(switcher.has_css_class("large-icons"))
|
||||
self.assertTrue(switcher.has_css_class("osd"))
|
||||
|
|
Loading…
Reference in New Issue
Block a user