ui: Replace the window's Grid with a Box

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2021-07-14 15:13:17 -04:00
parent 70f9bc5015
commit 18d001d0f0
2 changed files with 8 additions and 12 deletions

View File

@ -19,15 +19,13 @@ class TestUIWindow(unittest.TestCase):
def test_window_init(self):
self.assertIsInstance(window.Window, Gtk.ApplicationWindow)
self.assertIsInstance(window.Grid, Gtk.Grid)
self.assertIsInstance(window.Sep, Gtk.Separator)
self.assertIsInstance(window.Box, Gtk.Box)
self.assertIn(sidebar.Switcher, window.Grid)
self.assertIn(pane.Pane, window.Grid)
self.assertIn(window.Sep, window.Grid)
self.assertIn(sidebar.Switcher, window.Box)
self.assertIn(pane.Pane, window.Box)
self.assertEqual(window.Window.get_titlebar(), header.Header)
self.assertEqual(window.Window.get_child(), window.Grid)
self.assertEqual(window.Window.get_child(), window.Box)
window.Window.present()
self.assertEqual(window.Window.get_title(), version.string())

View File

@ -9,8 +9,7 @@ from . import header
from . import pane
Window = Gtk.ApplicationWindow()
Grid = Gtk.Grid()
Sep = Gtk.Separator.new(Gtk.Orientation.HORIZONTAL)
Box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)
def initialize():
settings.initialize("window.width", 1100)
@ -18,14 +17,13 @@ def initialize():
settings.initialize("window.maximized", False)
initialize()
Grid.attach(sidebar.Switcher, 0, 0, 1, 2)
Grid.attach(pane.Pane, 1, 0, 4, 1)
Grid.attach(Sep, 1, 1, 4, 1)
Box.append(sidebar.Switcher)
Box.append(pane.Pane)
Window.set_title(version.string())
Window.set_icon_name("emmental")
Window.set_titlebar(header.Header)
Window.set_child(Grid)
Window.set_child(Box)
Window.set_default_size(settings.get_int("window.width"),
settings.get_int("window.height"))
if settings.get_bool("window.maximized"):