Skip to content

Commit

Permalink
Improved layout rendering in response to different widget width ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtyomZorin committed Dec 10, 2022
1 parent f68e003 commit 95bfeaf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
zorin-exec-guard (1.5.7) focal; urgency=medium

* Improved layout rendering in response to different widget width
ranges

-- Artyom Zorin <[email protected]> Sat, 10 Dec 2022 18:37:39 +0000

zorin-exec-guard (1.5.6) focal; urgency=medium

* Corrected alignment for button and link container
Expand Down
29 changes: 19 additions & 10 deletions zorin_exec_guard/exec_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,15 @@ def _create_window(self):
self.window.set_position(Gtk.WindowPosition.CENTER)

box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,
halign=Gtk.Align.FILL,
hexpand=True,
margin=18,
spacing=18,
visible=True)
self.window.add(box)

information_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL,
halign=Gtk.Align.START,
halign=Gtk.Align.FILL,
hexpand=True,
margin_left=18,
spacing=36)
Expand All @@ -240,22 +242,28 @@ def _create_window(self):

message_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,
valign=Gtk.Align.START,
halign=Gtk.Align.FILL,
hexpand=True,
spacing=18)

label = Gtk.Label(use_markup=True,
wrap=True,
max_width_chars=40,
halign=Gtk.Align.CENTER,
label=title(self._get_main_message()))
wrap=True,
halign=Gtk.Align.START,
width_chars=30,
max_width_chars=50,
xalign=0,
label=title(self._get_main_message()))
message_box.add(label)

app_alternative_message = self._get_app_alternative_message()
if app_alternative_message:
label = Gtk.Label(use_markup=True,
wrap=True,
max_width_chars=40,
halign=Gtk.Align.START,
label=app_alternative_message )
wrap=True,
halign=Gtk.Align.START,
width_chars=30,
max_width_chars=50,
xalign=0,
label=app_alternative_message )
message_box.add(label)

message_box.add(self._get_unknown_app_warning_message())
Expand All @@ -272,7 +280,8 @@ def _create_window(self):
halign=Gtk.Align.START,
spacing=6)
self._get_links(link_box)
actions_box.pack_start(link_box, False, False, 0)
if len(link_box.get_children()) > 0:
actions_box.pack_start(link_box, False, False, 0)

button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL,
halign=Gtk.Align.END,
Expand Down

0 comments on commit 95bfeaf

Please sign in to comment.