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 c5b42a2

Browse filesBrowse files
committed
Declare qt figureoptions tool in toolitems.
... rather than specialcasing it in _init_toolbar.
1 parent 2aba5aa commit c5b42a2
Copy full SHA for c5b42a2

File tree

Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed

‎lib/matplotlib/backends/backend_qt5.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5.py
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,13 @@ def set_window_title(self, title):
652652
class NavigationToolbar2QT(NavigationToolbar2, QtWidgets.QToolBar):
653653
message = QtCore.Signal(str)
654654

655+
toolitems = [*NavigationToolbar2.toolitems]
656+
toolitems.insert(
657+
# Add 'customize' action after 'subplots'
658+
[name for name, *_ in toolitems].index("Subplots") + 1,
659+
("Customize", "Edit axis, curve and image parameters",
660+
"qt4_editor_options", "edit_parameters"))
661+
655662
def __init__(self, canvas, parent, coordinates=True):
656663
"""coordinates: should we show the coordinates on the right?"""
657664
self.canvas = canvas
@@ -695,11 +702,6 @@ def _init_toolbar(self):
695702
a.setCheckable(True)
696703
if tooltip_text is not None:
697704
a.setToolTip(tooltip_text)
698-
if text == 'Subplots':
699-
a = self.addAction(self._icon("qt4_editor_options.png",
700-
icon_color),
701-
'Customize', self.edit_parameters)
702-
a.setToolTip('Edit axis, curve and image parameters')
703705

704706
# Add the (x, y) location widget at the right side of the toolbar
705707
# The stretch factor is 1 which means any resizing of the toolbar

0 commit comments

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