window: Add a GtkGrid as the window's main child

We'll pack in more widgets later

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2021-06-22 10:55:42 -04:00
parent 3566db7ede
commit ac5c8c30d8
2 changed files with 5 additions and 0 deletions

View File

@ -17,7 +17,10 @@ class TestUIWindow(unittest.TestCase):
def test_window_init(self):
self.assertIsInstance(window.Window, Gtk.ApplicationWindow)
self.assertIsInstance(window.Grid, Gtk.Grid)
self.assertEqual(window.Window.get_titlebar(), header.Header)
self.assertEqual(window.Window.get_child(), window.Grid)
window.Window.present()
self.assertEqual(window.Window.get_title(), version.string())

View File

@ -7,6 +7,7 @@ from gi.repository import Gtk
from . import header
Window = Gtk.ApplicationWindow()
Grid = Gtk.Grid()
def initialize():
settings.initialize("window.width", 1100)
@ -17,6 +18,7 @@ initialize()
Window.set_title(version.string())
Window.set_icon_name("emmental")
Window.set_titlebar(header.Header)
Window.set_child(Grid)
Window.set_default_size(settings.get_int("window.width"),
settings.get_int("window.height"))
if settings.get_bool("window.maximized"):