diff --git a/ui/pane.py b/ui/pane.py index 2654ee4..2818de6 100644 --- a/ui/pane.py +++ b/ui/pane.py @@ -9,11 +9,10 @@ class Pane(Gtk.Paned): Gtk.Paned.__init__(self) # Suppress some warnings during testing - if sidebar.Box.get_parent(): sidebar.Box.unparent() if playlist.Box.get_parent(): playlist.Box.unparent() self.set_shrink_start_child(False) - self.set_start_child(sidebar.Box) + self.set_start_child(sidebar.Sidebar()) self.set_end_child(playlist.Box) self.set_vexpand(True) diff --git a/ui/test_pane.py b/ui/test_pane.py index f44d3f8..f89b911 100644 --- a/ui/test_pane.py +++ b/ui/test_pane.py @@ -14,8 +14,8 @@ class TestPane(unittest.TestCase): paned = pane.Pane() self.assertIsInstance(paned, Gtk.Paned) + self.assertIsInstance(paned.get_start_child(), sidebar.Sidebar) self.assertEqual(paned.get_orientation(), Gtk.Orientation.HORIZONTAL) - self.assertEqual(paned.get_start_child(), sidebar.Box) self.assertEqual(paned.get_end_child(), playlist.Box) self.assertFalse(paned.get_shrink_start_child()) self.assertTrue(paned.get_vexpand()) diff --git a/ui/test_window.py b/ui/test_window.py index bf8949f..61c805d 100644 --- a/ui/test_window.py +++ b/ui/test_window.py @@ -8,18 +8,6 @@ from . import keyboard from . import pane from . import window -class TestBox(unittest.TestCase): - def test_init(self): - box = window.Box() - self.assertIsInstance(box, Gtk.Box) - self.assertEqual(box.get_orientation(), Gtk.Orientation.HORIZONTAL) - - child = box.get_first_child() - self.assertEqual(child, sidebar.Switcher) - child = child.get_next_sibling() - self.assertIsInstance(child, pane.Pane) - - class TestWindow(unittest.TestCase): def setUp(self): lib.settings.reset() @@ -28,7 +16,7 @@ class TestWindow(unittest.TestCase): win = window.Window() self.assertIsInstance(win, Gtk.ApplicationWindow) self.assertIsInstance(win.get_titlebar(), audio.Header) - self.assertIsInstance(win.get_child(), window.Box) + self.assertIsInstance(win.get_child(), pane.Pane) self.assertEqual(win.get_icon_name(), "emmental") self.assertEqual(win.get_title(), lib.version.string()) diff --git a/ui/window.py b/ui/window.py index a262553..4d361a5 100644 --- a/ui/window.py +++ b/ui/window.py @@ -6,21 +6,13 @@ from gi.repository import Gtk from . import keyboard from . import pane -class Box(Gtk.Box): - def __init__(self): - Gtk.Box.__init__(self) - if sidebar.Switcher.get_parent(): sidebar.Switcher.unparent() - self.append(sidebar.Switcher) - self.append(pane.Pane()) - - class Window(Gtk.ApplicationWindow): def __init__(self): Gtk.ApplicationWindow.__init__(self) self.set_icon_name("emmental") self.set_title(lib.version.string()) self.set_titlebar(audio.Header()) - self.set_child(Box()) + self.set_child(pane.Pane()) self.add_controller(keyboard.Event) lib.settings.initialize("window.width", 1400)