sidebar: Create an AddPlaylistButton
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
5b5d166db3
commit
7be89be250
|
@ -99,3 +99,12 @@ class TestAddPlaylistPopover(unittest.TestCase):
|
|||
self.assertIsInstance(child, view.UserView)
|
||||
child = child.get_next_sibling()
|
||||
self.assertIsInstance(child, widgets.AddPlaylistEntry)
|
||||
|
||||
|
||||
class TestAddPlaylistButton(unittest.TestCase):
|
||||
def test_init(self):
|
||||
add = widgets.AddPlaylistButton()
|
||||
self.assertIsInstance(add, Gtk.MenuButton)
|
||||
self.assertIsInstance(add.get_popover(), widgets.AddPlaylistPopover)
|
||||
self.assertEqual(add.get_icon_name(), "list-add")
|
||||
self.assertEqual(add.get_direction(), Gtk.ArrowType.UP)
|
||||
|
|
|
@ -62,3 +62,11 @@ class AddPlaylistPopover(Gtk.Popover):
|
|||
self.box.append(AddPlaylistEntry())
|
||||
self.box.set_focus_child(self.box.get_last_child())
|
||||
self.set_child(self.box)
|
||||
|
||||
|
||||
class AddPlaylistButton(Gtk.MenuButton):
|
||||
def __init__(self):
|
||||
Gtk.MenuButton.__init__(self)
|
||||
self.set_icon_name("list-add")
|
||||
self.set_direction(Gtk.ArrowType.UP)
|
||||
self.set_popover(AddPlaylistPopover())
|
||||
|
|
Loading…
Reference in New Issue