8000 Declare qt figureoptions tool in toolitems. by anntzer · Pull Request #15262 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Declare qt figureoptions tool in toolitems. #15262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/matplotlib/backends/backend_qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,13 @@ def set_window_title(self, title):
class NavigationToolbar2QT(NavigationToolbar2, QtWidgets.QToolBar):
message = QtCore.Signal(str)

toolitems = [*NavigationToolbar2.toolitems]
toolitems.insert(
# Add 'customize' action after 'subplots'
[name for name, *_ in toolitems].index("Subplots") + 1,
("Customize", "Edit axis, curve and image parameters",
"qt4_editor_options", "edit_parameters"))

def __init__(self, canvas, parent, coordinates=True):
"""coordinates: should we show the coordinates on the right?"""
self.canvas = canvas
Expand Down Expand Up @@ -695,11 +702,6 @@ def _init_toolbar(self):
a.setCheckable(True)
if tooltip_text is not None:
a.setToolTip(tooltip_text)
if text == 'Subplots':
a = self.addAction(self._icon("qt4_editor_options.png",
icon_color),
'Customize', self.edit_parameters)
a.setToolTip('Edit axis, curve and image parameters')

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