Skip to content

Commit

Permalink
Added docktype keyword to DockMixin.to_dock method
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilipp committed Mar 3, 2017
1 parent 7883788 commit d887a40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion psyplot_gui/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def __init__(self, canvas, num):
parent_widget = FigureWidget()
parent_widget.vbox = vbox = QVBoxLayout()
self.window = dock = parent_widget.to_dock(
mainwindow, title="Figure %d" % num, position=Qt.TopDockWidgetArea)
mainwindow, title="Figure %d" % num, position=Qt.TopDockWidgetArea,
docktype=None)
if mainwindow.figures:
mainwindow.tabifyDockWidget(mainwindow.figures[-1], dock)
mainwindow.figures.append(dock)
Expand Down
5 changes: 3 additions & 2 deletions psyplot_gui/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class DockMixin(object):
#: The class to use for the DockWidget
dock_cls = QDockWidget

def to_dock(self, main, title=None, position=None, *args, **kwargs):
def to_dock(self, main, title=None, position=None, docktype='pane', *args,
**kwargs):
if title is None:
title = self.title
if title is None:
Expand All @@ -48,7 +49,7 @@ def to_dock(self, main, title=None, position=None, *args, **kwargs):
title, self))
self.dock = self.dock_cls(title, main)
self.dock.setWidget(self)
main.addDockWidget(position, self.dock, 'pane', *args, **kwargs)
main.addDockWidget(position, self.dock, docktype, *args, **kwargs)
return self.dock


Expand Down

0 comments on commit d887a40

Please sign in to comment.