From 1ab8be5304bee29fbab25d8d768f50218ae4256e Mon Sep 17 00:00:00 2001 From: Alfredo Monclus Date: Wed, 12 Jun 2024 10:52:34 -0300 Subject: [PATCH] kgtk: button avoid extra if --- ks_includes/KlippyGtk.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ks_includes/KlippyGtk.py b/ks_includes/KlippyGtk.py index 5d40b737..7245ea55 100644 --- a/ks_includes/KlippyGtk.py +++ b/ks_includes/KlippyGtk.py @@ -162,6 +162,7 @@ class KlippyGtk: b = Gtk.Button(hexpand=True, vexpand=True, can_focus=False, image_position=position, always_show_image=True) if label is not None: b.set_label(label.replace("\n", " ")) + format_label(b, lines) if image_name is not None: b.set_name(image_name) if scale is None: @@ -175,9 +176,6 @@ class KlippyGtk: box = find_widget(b, Gtk.Box) if box: box.add(spinner) - - if label is not None: - format_label(b, lines) if style is not None: b.get_style_context().add_class(style) b.connect("clicked", self.screen.reset_screensaver_timeout)