panels: simplificate panel sub-menu system

This commit is contained in:
alfrix
2024-05-12 15:53:45 -03:00
parent dc61787960
commit 1afc67b354
6 changed files with 13 additions and 29 deletions

View File

@@ -323,6 +323,8 @@ class KlipperScreen(Gtk.Window):
def attach_panel(self, panel):
self.base_panel.add_content(self.panels[panel])
logging.debug(f"Current panel hierarchy: {' > '.join(self._cur_panels)}")
while len(self.panels[panel].menu) > 1:
self.panels[panel].unload_menu()
if hasattr(self.panels[panel], "process_update"):
self.process_update("notify_status_update", self.printer.data)
if hasattr(self.panels[panel], "activate"):