From aab42eef39f7a0dc8732667e9ff4b6b3f3cad460 Mon Sep 17 00:00:00 2001 From: Alfredo Monclus Date: Wed, 19 Jun 2024 12:09:34 -0300 Subject: [PATCH] layout: fix indent when using word_char wrap --- ks_includes/screen_panel.py | 4 ++-- panels/gcodes.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ks_includes/screen_panel.py b/ks_includes/screen_panel.py index 3e5c0ee6..f981b485 100644 --- a/ks_includes/screen_panel.py +++ b/ks_includes/screen_panel.py @@ -210,7 +210,7 @@ class ScreenPanel: return name = Gtk.Label( hexpand=True, vexpand=True, halign=Gtk.Align.START, valign=Gtk.Align.CENTER, - wrap=True, wrap_mode=Pango.WrapMode.CHAR) + wrap=True, wrap_mode=Pango.WrapMode.WORD_CHAR, xalign=0) name.set_markup(f"{option['name']}") labels = Gtk.Box(spacing=0, orientation=Gtk.Orientation.VERTICAL, valign=Gtk.Align.CENTER) @@ -219,7 +219,7 @@ class ScreenPanel: tooltip = Gtk.Label( label=option['tooltip'], hexpand=True, vexpand=True, halign=Gtk.Align.START, valign=Gtk.Align.CENTER, - wrap=True, wrap_mode=Pango.WrapMode.CHAR) + wrap=True, wrap_mode=Pango.WrapMode.WORD_CHAR, xalign=0) labels.add(tooltip) row_box = Gtk.Box(spacing=5, valign=Gtk.Align.CENTER, hexpand=True, vexpand=False) diff --git a/panels/gcodes.py b/panels/gcodes.py index e8d56d34..225073c4 100644 --- a/panels/gcodes.py +++ b/panels/gcodes.py @@ -143,7 +143,10 @@ class Panel(ScreenPanel): if self.list_mode: label = Gtk.Label(label=basename, hexpand=True, vexpand=False) format_label(label) - info = Gtk.Label(hexpand=True, halign=Gtk.Align.START, wrap=True, wrap_mode=Pango.WrapMode.WORD_CHAR) + info = Gtk.Label( + hexpand=True, halign=Gtk.Align.START, xalign=0, + wrap=True, wrap_mode=Pango.WrapMode.WORD_CHAR, + ) info.get_style_context().add_class("print-info") info.set_markup(self.get_info_str(item, path)) delete = Gtk.Button(hexpand=False, vexpand=False, can_focus=False, always_show_image=True)