Fix macro shortcut reopening the same panel

This commit is contained in:
alfrix 2023-06-04 08:09:11 -03:00
parent 1e4885d291
commit 2d61eba66b
2 changed files with 7 additions and 0 deletions

View File

@ -274,6 +274,9 @@ class BasePanel(ScreenPanel):
self.action_bar.remove(self.control['macros_shortcut'])
self.buttons_showing['macros_shortcut'] = False
def toggle_macro_shorcut_sensitive(self, value=True):
self.control['macros_shortcut'].set_sensitive(value)
def show_printer_select(self, show=True):
if show and self.buttons_showing['printer_select'] is False:
self.action_bar.add(self.control['printer_select'])

View File

@ -50,6 +50,10 @@ class MacroPanel(ScreenPanel):
while len(self.menu) > 1:
self.unload_menu()
self.reload_macros()
self._screen.base_panel.toggle_macro_shorcut_sensitive(False)
def deactivate(self):
self._screen.base_panel.toggle_macro_shorcut_sensitive(True)
def add_gcode_macro(self, macro):
# Support for hiding macros by name