From e4ca62448b676d9cf90d5debe4ab834bd5cc1a2a Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 11 Dec 2013 14:28:56 -0500 Subject: [PATCH] Added Dock.raiseDock() method --- pyqtgraph/dockarea/Container.py | 7 +++++++ pyqtgraph/dockarea/Dock.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/pyqtgraph/dockarea/Container.py b/pyqtgraph/dockarea/Container.py index 83610937..01ae51d3 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 414980ac..09a97813 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."""