diff --git a/ks_includes/KlippyGtk.py b/ks_includes/KlippyGtk.py index 835b5f74..7565f492 100644 --- a/ks_includes/KlippyGtk.py +++ b/ks_includes/KlippyGtk.py @@ -11,6 +11,7 @@ klipperscreendir = os.getcwd() class KlippyGtk: labels = {} font_ratio = [51, 30] + keyboard_ratio = .22 width_ratio = 16 height_ratio = 9.375 @@ -42,6 +43,9 @@ class KlippyGtk: def get_content_height(self): return self.height - self.header_size + def get_font_size(self): + return self.font_size + def get_header_size(self): return self.header_size @@ -54,8 +58,8 @@ class KlippyGtk: def get_image_height(self): return self.img_height - def get_font_size(self): - return self.font_size + def get_keyboard_height(self): + return (self.width - self.get_action_bar_width()) * self.keyboard_ratio def Label(self, label, style=None): l = Gtk.Label(label) diff --git a/screen.py b/screen.py index dfede8bf..8d300dd8 100644 --- a/screen.py +++ b/screen.py @@ -120,6 +120,7 @@ class KlipperScreen(Gtk.Window): self.theme = self._config.get_main_config_option('theme') self.gtk = KlippyGtk(self, self.width, self.height, self.theme) + self.keyboard_height = self.gtk.get_keyboard_height() self.init_style() self.base_panel = BasePanel(self, "Base Panel", False)