From b78ebea6871f4250e86bd37dd79f4c867acf3464 Mon Sep 17 00:00:00 2001 From: Jordan Ruthe Date: Mon, 22 Feb 2021 11:40:21 -0500 Subject: [PATCH] screen: Allow cursor to be displayed #51 --- docs/Configuration.md | 3 +++ docs/changelog.md | 1 + screen.py | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index bb053f86..3e45c25a 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -24,6 +24,9 @@ job_complete_timeout: 30 # If this option is 0, the user must click on a button to go back to the main menu. job_error_timeout: 0 +# Allows the cursor to be displayed on the screen +show_cursor: False + # # The following main options are deprecated and will be removed in the near future # diff --git a/docs/changelog.md b/docs/changelog.md index 9b7748fe..a25e834d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -4,6 +4,7 @@ * Add configurable z_babystep intervals * Fixed cursor issue on startup * Fixed font ratio for large, but short screens +* Configurable cursor display * Re-vamped logging system #### 2021 02 19 diff --git a/screen.py b/screen.py index 2d0e3360..35ee51d0 100644 --- a/screen.py +++ b/screen.py @@ -113,7 +113,10 @@ class KlipperScreen(Gtk.Window): self.set_screenblanking_timeout(self._config.get_main_config_option('screen_blanking')) # Change cursor to blank - self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR)) + if self._config.get_main_config().getboolean("show_cursor", fallback=False): + self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW)) + else: + self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR)) pname = list(self._config.get_printers()[0])[0] self.connect_printer(pname, self._config.get_printers()[0][pname])