[gnome-tweaks/ewlsh/fix-window-sizing] Fix default window sizing and requests.




commit 6d023f853fb0ba13e9b3d1c425566f076af91513
Author: Evan Welsh <contact evanwelsh com>
Date:   Fri Oct 23 18:17:23 2020 -0500

    Fix default window sizing and requests.
    
    For main content we can lower our minimum to 540 to accomodate smaller screens, for the sidebar we should 
request on the box itself, and for the window we should call default_size in addition to a smaller default.

 gtweak/tweakview.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtweak/tweakview.py b/gtweak/tweakview.py
index 5de11d6b..ef9b1ccf 100644
--- a/gtweak/tweakview.py
+++ b/gtweak/tweakview.py
@@ -16,7 +16,8 @@ class Window(Gtk.ApplicationWindow):
         Gtk.ApplicationWindow.__init__(self,
                                        application=app,
                                        show_menubar=False)
-        self.set_size_request(-1, 700)
+        self.set_default_size(980, 640)
+        self.set_size_request(-1, 300)
         self.set_position(Gtk.WindowPosition.CENTER)
         self.set_icon_name("org.gnome.tweaks")
 
@@ -139,6 +140,7 @@ class Window(Gtk.ApplicationWindow):
 
     def sidebar(self):
         left_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
+        left_box.set_size_request(200, -1)
 
         self.entry = Gtk.SearchEntry(placeholder_text=_("Search Tweaks…"))
         if (Gtk.check_version(3, 22, 20) is None):
@@ -151,7 +153,6 @@ class Window(Gtk.ApplicationWindow):
 
         self.listbox = Gtk.ListBox()
         self.listbox.get_style_context().add_class("tweak-categories")
-        self.listbox.set_size_request(200, -1)
         self.listbox.connect("row-selected", self._on_select_row)
         self.listbox.set_header_func(self._list_header_func, None)
         scroll = Gtk.ScrolledWindow()
@@ -168,7 +169,7 @@ class Window(Gtk.ApplicationWindow):
 
     def main_content(self):
         right_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
-        right_box.set_size_request(750, -1)
+        right_box.set_size_request(540, -1)
 
         self.stack = Gtk.Stack()
         self.stack.get_style_context().add_class("main-container")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]