klippygtk: dialog buttons height as variable

This commit is contained in:
alfrix 2024-01-15 11:27:21 -03:00
parent 58d1c04221
commit 18f8d32aa6
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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)