Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0f31553

Browse filesBrowse files
committed
Restrict Qt toolbars to top/bottom of canvas.
Qt toolbars are movable by default, but having them to the left or right and vertical makes no sense now that we also display the coordinates text in them (and probably breaks assumptions about resize too, anyways).
1 parent fbbc84f commit 0f31553
Copy full SHA for 0f31553

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

‎lib/matplotlib/backends/backend_qt5.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,8 @@ class NavigationToolbar2QT(NavigationToolbar2, QtWidgets.QToolBar):
649649
def __init__(self, canvas, parent, coordinates=True):
650650
"""coordinates: should we show the coordinates on the right?"""
651651
QtWidgets.QToolBar.__init__(self, parent)
652+
self.setAllowedAreas(
653+
QtCore.Qt.TopToolBarArea | QtCore.Qt.BottomToolBarArea)
652654

653655
self._parent = parent
654656
self.coordinates = coordinates
@@ -888,6 +890,8 @@ class ToolbarQt(ToolContainerBase, QtWidgets.QToolBar):
888890
def __init__(self, toolmanager, parent):
889891
ToolContainerBase.__init__(self, toolmanager)
890892
QtWidgets.QToolBar.__init__(self, parent)
893+
self.setAllowedAreas(
894+
QtCore.Qt.TopToolBarArea | QtCore.Qt.BottomToolBarArea)
891895
self._toolitems = {}
892896
self._groups = {}
893897

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.