Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help text in policy editor is wrapped to too wide size #204

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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