Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/204'
Browse files Browse the repository at this point in the history
* origin/pr/204:
  Fixing policy editor window size on 1024x168 displays
  Help text in policy editor is wrapped to too wide size
  • Loading branch information
marmarek committed Jul 18, 2024
2 parents af34311 + d2f37e1 commit 5377b51
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
12 changes: 6 additions & 6 deletions qubes_config/policy_editor.glade
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
</child>
</object>
<object class="GtkApplicationWindow" id="main_window">
<property name="height-request">800</property>
<property name="can-focus">False</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
Expand Down Expand Up @@ -103,7 +102,7 @@
</child>
<child>
<object class="GtkScrolledWindow" id="source_window">
<property name="width-request">1000</property>
<property name="width-request">750</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="vexpand">True</property>
Expand Down Expand Up @@ -147,20 +146,21 @@
</child>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">True</property>
<property name="resize">True</property>
<property name="shrink">False</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="help_window">
<property name="width-request">500</property>
<property name="width-request">270</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport" id="help_viewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="border_width">5</property>
<child>
<object class="GtkLabel" id="help_label">
<property name="visible">True</property>
Expand All @@ -177,7 +177,7 @@
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">True</property>
<property name="shrink">False</property>
</packing>
</child>
</object>
Expand Down
10 changes: 10 additions & 0 deletions qubes_config/policy_editor/policy_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5377b51

Please sign in to comment.