diff --git a/ks_includes/KlippyGtk.py b/ks_includes/KlippyGtk.py index 5d2158c0..99fbb8d9 100644 --- a/ks_includes/KlippyGtk.py +++ b/ks_includes/KlippyGtk.py @@ -5,7 +5,7 @@ import os gi.require_version("Gtk", "3.0") from gi.repository import Gtk, Gdk, GdkPixbuf, Gio, GLib, Pango -import os + klipperscreendir = os.getcwd() class KlippyGtk: @@ -15,9 +15,8 @@ class KlippyGtk: width_ratio = 16 height_ratio = 9.375 - def __init__(self, screen, width, height, theme): + def __init__(self, screen, width, height, theme, cursor): self.screen = screen - self.width = width self.height = height self.theme = theme @@ -31,6 +30,7 @@ class KlippyGtk: self.action_bar_width = int(self.width * .1) self.header_image_scale_width = 1.2 self.header_image_scale_height = 1.4 + self.cursor = cursor logging.debug("img width: %s height: %s" % (self.img_width, self.img_height)) @@ -178,7 +178,7 @@ class KlippyGtk: def Dialog(self, screen, buttons, content, callback=None, *args): dialog = Gtk.Dialog() - dialog.set_default_size(screen.width - 15, screen.height - 15) + dialog.set_default_size(screen.width, screen.height) dialog.set_resizable(False) dialog.set_transient_for(screen) dialog.set_modal(True) @@ -201,6 +201,11 @@ class KlippyGtk: content_area.add(content) dialog.show_all() + # Change cursor to blank + if self.cursor: + dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW)) + else: + dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR)) return dialog diff --git a/panels/system.py b/panels/system.py index 86535a58..cac8b9fd 100644 --- a/panels/system.py +++ b/panels/system.py @@ -178,6 +178,7 @@ class SystemPanel(ScreenPanel): date = ndate label = Gtk.Label("") label.set_markup("%s\n" % date) + label.set_halign(Gtk.Align.START) grid.attach(label, 0, i, 1, 1) i = i + 1 diff --git a/screen.py b/screen.py index c972462a..c044d67a 100644 --- a/screen.py +++ b/screen.py @@ -119,7 +119,7 @@ class KlipperScreen(Gtk.Window): logging.info("Screen resolution: %sx%s" % (self.width, self.height)) self.theme = self._config.get_main_config_option('theme') - self.gtk = KlippyGtk(self, self.width, self.height, self.theme) + self.gtk = KlippyGtk(self, self.width, self.height, self.theme, self._config.get_main_config().getboolean("show_cursor", fallback=False)) self.keyboard_height = self.gtk.get_keyboard_height() self.init_style()