From c27d058b01fe604eccec76454e39360122e48515 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Tue, 19 Nov 2024 15:11:25 +0100 Subject: [PATCH] fix(rpc): gui hide/show also hide/show all floating docks --- bec_widgets/cli/client.py | 12 ++++++++++++ bec_widgets/widgets/containers/dock/dock_area.py | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index 42bfa1ea..afdb8492 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -461,6 +461,18 @@ class BECDockArea(RPCBase, BECGuiClientMixin): list: The temporary areas in the dock area. """ + @rpc_call + def show(self): + """ + Show all windows including floating docks. + """ + + @rpc_call + def hide(self): + """ + Hide all windows including floating docks. + """ + class BECFigure(RPCBase): @property diff --git a/bec_widgets/widgets/containers/dock/dock_area.py b/bec_widgets/widgets/containers/dock/dock_area.py index 0b74bc4f..34332147 100644 --- a/bec_widgets/widgets/containers/dock/dock_area.py +++ b/bec_widgets/widgets/containers/dock/dock_area.py @@ -53,6 +53,8 @@ class BECDockArea(BECWidget, QWidget): "attach_all", "_get_all_rpc", "temp_areas", + "show", + "hide", ] def __init__( @@ -412,6 +414,18 @@ class BECDockArea(BECWidget, QWidget): self.cleanup() super().close() + def show(self): + """Show all windows including floating docks.""" + super().show() + for docks in self.panels.values(): + docks.window().show() + + def hide(self): + """Hide all windows including floating docks.""" + super().hide() + for docks in self.panels.values(): + docks.window().hide() + if __name__ == "__main__": from qtpy.QtWidgets import QApplication