main_menu: allow closing the keypad with the back button

This commit is contained in:
alfrix
2023-08-03 15:53:26 -03:00
committed by Alfredo Monclus
parent 189df7921f
commit 5fa1e44f16
3 changed files with 17 additions and 6 deletions

View File

@@ -63,6 +63,7 @@ class BasePanel(ScreenPanel):
self.action_bar.add(self.control['back'])
self.action_bar.add(self.control['home'])
self.show_back(False)
self.show_home(False)
if self.buttons_showing['printer_select']:
self.action_bar.add(self.control['printer_select'])
self.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True))
@@ -255,12 +256,10 @@ class BasePanel(ScreenPanel):
self.content.remove(widget)
def show_back(self, show=True):
if show:
self.control['back'].set_sensitive(True)
self.control['home'].set_sensitive(True)
return
self.control['back'].set_sensitive(False)
self.control['home'].set_sensitive(False)
self.control['back'].set_sensitive(show)
def show_home(self, show=True):
self.control['home'].set_sensitive(show)
def show_macro_shortcut(self, show=True):
if show is True and self.buttons_showing['macros_shortcut'] is False: