From 03614c0aa2e4f09b4f056fbf4aca2a7ea8a44efa Mon Sep 17 00:00:00 2001 From: Ali Mirjamali Date: Sun, 30 Jun 2024 13:07:37 +0330 Subject: [PATCH 1/2] Help text in policy editor is wrapped to too wide size Fixes: https://github.com/QubesOS/qubes-issues/issues/9060 --- qubes_config/policy_editor.glade | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/qubes_config/policy_editor.glade b/qubes_config/policy_editor.glade index 4d83c62d..03033de2 100644 --- a/qubes_config/policy_editor.glade +++ b/qubes_config/policy_editor.glade @@ -40,7 +40,7 @@ - 800 + 700 False False False @@ -103,7 +103,7 @@ - 1000 + 800 True True True @@ -147,13 +147,13 @@ - False - True + True + False - 500 + 450 True True in @@ -161,6 +161,7 @@ True False + 5 True From d2f37e1a8658abeacf4223d9555013bc1157d430 Mon Sep 17 00:00:00 2001 From: Ali Mirjamali Date: Tue, 9 Jul 2024 16:03:04 +0330 Subject: [PATCH 2/2] Fixing policy editor window size on 1024x168 displays Also improving Window size on other display sizes --- qubes_config/policy_editor.glade | 7 +++---- qubes_config/policy_editor/policy_editor.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/qubes_config/policy_editor.glade b/qubes_config/policy_editor.glade index 03033de2..03c8418a 100644 --- a/qubes_config/policy_editor.glade +++ b/qubes_config/policy_editor.glade @@ -40,7 +40,6 @@ - 700 False False False @@ -103,7 +102,7 @@ - 800 + 750 True True True @@ -153,7 +152,7 @@ - 450 + 270 True True in @@ -178,7 +177,7 @@ True - True + False diff --git a/qubes_config/policy_editor/policy_editor.py b/qubes_config/policy_editor/policy_editor.py index 36bc5ef1..49ddb28d 100644 --- a/qubes_config/policy_editor/policy_editor.py +++ b/qubes_config/policy_editor/policy_editor.py @@ -184,6 +184,16 @@ def perform_setup(self): self.main_window : Gtk.ApplicationWindow = \ self.builder.get_object('main_window') + # Reserving 3 pixels for window border on all sides (most themes use 2) + # Reserving 32x2 pixels for taskbar (default on top) and Window title. + # Setting minimum supported size + self.main_window.set_size_request(1024 - 3*2, 768 - 3*2 - 32*2) + width = min(1920, self.main_window.get_screen().get_width()) + height= min(1280, self.main_window.get_screen().get_height()) + self.main_window.set_default_size(width - 3*2, height - 3*2 - 32*2) + # ToDo: Considering maximizing by default as it packs too much info. + # self.main_window.maximize() + # setup source and help header_box: Gtk.Box = self.builder.get_object('header_box') self.header_view = GtkSource.View()