Added Dock.raiseDock() method

This commit is contained in:
Luke Campagnola 2013-12-11 14:28:56 -05:00
parent bc7bc29740
commit e4ca62448b
2 changed files with 12 additions and 0 deletions

View File

@ -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'

View File

@ -209,6 +209,11 @@ class Dock(QtGui.QWidget, DockDrop):
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."""
self.setParent(None)