From 3241830c8e692126648270db667c94e1431d21f9 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Mon, 23 Oct 2023 13:52:53 -0400 Subject: [PATCH] window: Remove the sidebar-size property The new Layout widget isn't user adjustable, so this property is now unused. Signed-off-by: Anna Schumaker --- emmental/__init__.py | 3 +-- emmental/window.py | 1 - tests/test_settings.py | 10 ---------- tests/test_window.py | 7 ------- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/emmental/__init__.py b/emmental/__init__.py index 84387ac..2873e0e 100644 --- a/emmental/__init__.py +++ b/emmental/__init__.py @@ -210,8 +210,7 @@ class Application(Adw.Application): for (setting, property) in [("window.width", "default-width"), ("window.height", "default-height"), - ("now-playing.size", "now-playing-size"), - ("sidebar.size", "sidebar-size")]: + ("now-playing.size", "now-playing-size")]: self.db.settings.bind_setting(setting, win, property) self.__add_accelerators(win.accelerators) diff --git a/emmental/window.py b/emmental/window.py index 0936d22..311a49a 100644 --- a/emmental/window.py +++ b/emmental/window.py @@ -30,7 +30,6 @@ class Window(Adw.Window): header = GObject.Property(type=Gtk.Widget) sidebar = GObject.Property(type=Gtk.Widget) - sidebar_size = GObject.Property(type=int, default=300) show_sidebar = GObject.Property(type=bool, default=False) now_playing = GObject.Property(type=Gtk.Widget) now_playing_size = GObject.Property(type=int, default=250) diff --git a/tests/test_settings.py b/tests/test_settings.py index b29280d..cfebae1 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -111,16 +111,6 @@ class TestSettings(unittest.TestCase): self.assertFalse(self.app.build_window().now_playing.prefer_artist) - def test_save_sidebar_size(self, mock_stdout: io.StringIO): - """Check saving and loading the sidebar widget size.""" - self.assertEqual(self.win.sidebar_size, 300) - self.assertEqual(self.settings["sidebar.size"], 300) - - self.win.sidebar_size = 400 - self.assertEqual(self.settings["sidebar.size"], 400) - - self.assertEqual(self.app.build_window().sidebar_size, 400) - def test_save_sidebar_show_all_artists(self, mock_stdout: io.StringIO): """Check saving and loading the show-all artists setting.""" self.assertFalse(self.win.sidebar.show_all_artists) diff --git a/tests/test_window.py b/tests/test_window.py index 7d5a0ee..71d07c0 100644 --- a/tests/test_window.py +++ b/tests/test_window.py @@ -86,13 +86,6 @@ class TestWindow(unittest.TestCase): self.window._layout.show_sidebar = False self.assertFalse(self.window.show_sidebar) - def test_sidebar_size(self): - """Check setting the size of the sidebar area.""" - self.assertEqual(self.window.sidebar_size, 300) - - self.window.sidebar_size = 100 - self.assertEqual(self.window.sidebar_size, 100) - def test_now_playing(self): """Check setting a widget to the now_playing area.""" self.assertIsNone(self.window.now_playing)