klippygtk: dialog buttons height as variable
This commit is contained in:
@@ -43,6 +43,7 @@ class KlippyGtk:
|
|||||||
self.img_scale = self.font_size * 2
|
self.img_scale = self.font_size * 2
|
||||||
self.button_image_scale = 1.38
|
self.button_image_scale = 1.38
|
||||||
self.bsidescale = .65 # Buttons with image at the side
|
self.bsidescale = .65 # Buttons with image at the side
|
||||||
|
self.dialog_buttons_height = round(self.height / 5)
|
||||||
|
|
||||||
if self.font_size_type == "max":
|
if self.font_size_type == "max":
|
||||||
self.font_size = self.font_size * 1.2
|
self.font_size = self.font_size * 1.2
|
||||||
@@ -216,7 +217,7 @@ class KlippyGtk:
|
|||||||
style = 'dialog-default'
|
style = 'dialog-default'
|
||||||
dialog.add_button(button['name'], button['response'])
|
dialog.add_button(button['name'], button['response'])
|
||||||
button = dialog.get_widget_for_response(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)
|
button.get_style_context().add_class(style)
|
||||||
format_label(button, 2)
|
format_label(button, 2)
|
||||||
|
|
||||||
|
@@ -289,7 +289,7 @@ class Panel(ScreenPanel):
|
|||||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||||
box.add(label)
|
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)
|
pixbuf = self.get_file_image(filename, self._screen.width * .9, height)
|
||||||
if pixbuf is not None:
|
if pixbuf is not None:
|
||||||
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||||
|
Reference in New Issue
Block a user