screen: Allow cursor to be displayed #51

This commit is contained in:
Jordan Ruthe 2021-02-22 11:40:21 -05:00
parent 3f2ed97385
commit b78ebea687
3 changed files with 8 additions and 1 deletions

View File

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

View File

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

View File

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