window: Add the sidebar Switcher to the Grid directly

Rather than putting it in the Gtk.Paned

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2021-07-14 14:52:59 -04:00
parent 146777119c
commit cf22a32fe7
4 changed files with 7 additions and 7 deletions

View File

@ -57,5 +57,4 @@ add_stack_page("Decades", tagbox.ParentTagBox(trackdb.tags.Decade, "x-office-c
add_stack_page("Libraries", library.Box)
Box.append(Switcher)
Box.append(Stack)

View File

@ -13,7 +13,6 @@ class TestSidebar(unittest.TestCase):
self.assertIsInstance(sidebar.Stack, Gtk.Stack)
self.assertIsInstance(sidebar.Box, Gtk.Box)
self.assertIn(sidebar.Switcher, sidebar.Box)
self.assertIn(sidebar.Stack, sidebar.Box)
def test_sidebar_pages(self):

View File

@ -6,6 +6,7 @@ from . import header
from . import pane
from . import pulser
from gi.repository import Gtk
import sidebar
import unittest
class TestUIWindow(unittest.TestCase):
@ -22,7 +23,7 @@ class TestUIWindow(unittest.TestCase):
self.assertIsInstance(window.Grid, Gtk.Grid)
self.assertIsInstance(window.Sep, Gtk.Separator)
self.assertTrue(window.Grid.get_column_homogeneous())
self.assertIn(sidebar.Switcher, window.Grid)
self.assertIn(pane.Pane, window.Grid)
self.assertIn(pulser.Bar, window.Grid)
self.assertIn(window.Sep, window.Grid)

View File

@ -1,6 +1,7 @@
# Copyright 2021 (c) Anna Schumaker.
from lib import settings
from lib import version
import sidebar
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk
@ -18,10 +19,10 @@ def initialize():
settings.initialize("window.maximized", False)
initialize()
Grid.set_column_homogeneous(True)
Grid.attach(pane.Pane, 0, 0, 4, 1)
Grid.attach(Sep, 0, 1, 4, 1)
Grid.attach(pulser.Bar, 0, 2, 1, 1)
Grid.attach(sidebar.Switcher, 0, 0, 1, 2)
Grid.attach(pane.Pane, 1, 0, 4, 1)
Grid.attach(Sep, 1, 1, 4, 1)
Grid.attach(pulser.Bar, 1, 2, 1, 1)
Window.set_title(version.string())
Window.set_icon_name("emmental")