diff --git a/pyqtgraph/dockarea/Container.py b/pyqtgraph/dockarea/Container.py index 83610937edb4d082fd9a28b15f92a52d90eff357..01ae51d36f2aac0633b3532137b6e41c43a20fee 100644 --- a/pyqtgraph/dockarea/Container.py +++ b/pyqtgraph/dockarea/Container.py @@ -241,6 +241,13 @@ class TContainer(Container, QtGui.QWidget): else: w.label.setDim(True) + def raiseDock(self, dock): + """Move *dock* to the top of the stack""" + self.stack.currentWidget().label.setDim(True) + self.stack.setCurrentWidget(dock) + dock.label.setDim(False) + + def type(self): return 'tab' diff --git a/pyqtgraph/dockarea/Dock.py b/pyqtgraph/dockarea/Dock.py index 414980ac718a59d1073af8c67a5ac438aa106120..09a97813c3c7d48190801c61e4c3aeee23d21f03 100644 --- a/pyqtgraph/dockarea/Dock.py +++ b/pyqtgraph/dockarea/Dock.py @@ -208,6 +208,11 @@ class Dock(QtGui.QWidget, DockDrop): self.moveLabel = False self.setOrientation(force=True) + + def raiseDock(self): + """If this Dock is stacked underneath others, raise it to the top.""" + self.container().raiseDock(self) + def close(self): """Remove this dock from the DockArea it lives inside."""