From 18f8d32aa6e4324154577274d7fa7512e0ddbd70 Mon Sep 17 00:00:00 2001 From: alfrix Date: Mon, 15 Jan 2024 11:27:21 -0300 Subject: [PATCH] klippygtk: dialog buttons height as variable --- ks_includes/KlippyGtk.py | 3 ++- panels/print.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ks_includes/KlippyGtk.py b/ks_includes/KlippyGtk.py index 189ea5f0..4d80d681 100644 --- a/ks_includes/KlippyGtk.py +++ b/ks_includes/KlippyGtk.py @@ -43,6 +43,7 @@ class KlippyGtk: self.img_scale = self.font_size * 2 self.button_image_scale = 1.38 self.bsidescale = .65 # Buttons with image at the side + self.dialog_buttons_height = round(self.height / 5) if self.font_size_type == "max": self.font_size = self.font_size * 1.2 @@ -216,7 +217,7 @@ class KlippyGtk: style = 'dialog-default' dialog.add_button(button['name'], button['response']) button = dialog.get_widget_for_response(button['response']) - button.set_size_request(button_hsize, round(self.height / 5)) + button.set_size_request(button_hsize, self.dialog_buttons_height) button.get_style_context().add_class(style) format_label(button, 2) diff --git a/panels/print.py b/panels/print.py index 2f1364af..7818d5d2 100644 --- a/panels/print.py +++ b/panels/print.py @@ -289,7 +289,7 @@ class Panel(ScreenPanel): box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) box.add(label) - height = self._screen.height * .9 - self._gtk.font_size * 10 + height = (self._screen.height - self._gtk.dialog_buttons_height - self._gtk.font_size) * .75 pixbuf = self.get_file_image(filename, self._screen.width * .9, height) if pixbuf is not None: image = Gtk.Image.new_from_pixbuf(pixbuf)