-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Don't create a statusbar in Qt, wx backends. #17092
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -550,23 +550,21 @@ def __init__(self, canvas, num): | |
if self.toolbar: | ||
backend_tools.add_tools_to_container(self.toolbar) | ||
self.statusbar = StatusbarQt(self.window, self.toolmanager) | ||
sbs_height = self.statusbar.sizeHint().height() | ||
else: | ||
sbs_height = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo? Is this the same as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually they should all be sbs_height, fixed |
||
|
||
if self.toolbar is not None: | ||
self.window.addToolBar(self.toolbar) | ||
if not self.toolmanager: | ||
# add text label to status bar | ||
statusbar_label = QtWidgets.QLabel() | ||
self.window.statusBar().addWidget(statusbar_label) | ||
self.toolbar.message.connect(statusbar_label.setText) | ||
tbs_height = self.toolbar.sizeHint().height() | ||
else: | ||
tbs_height = 0 | ||
|
||
# resize the main window so it will display the canvas with the | ||
# requested size: | ||
cs = canvas.sizeHint() | ||
sbs = self.window.statusBar().sizeHint() | ||
height = cs.height() + tbs_height + sbs.height() | ||
cs_height = cs.height() | ||
height = cs_height + tbs_height + sbs_height | ||
self.window.resize(cs.width(), height) | ||
|
||
self.window.setCentralWidget(self.canvas) | ||
|
@@ -599,7 +597,7 @@ def _get_toolbar(self, canvas, parent): | |
# must be inited after the window, drawingArea and figure | ||
# attrs are set | ||
if matplotlib.rcParams['toolbar'] == 'toolbar2': | ||
toolbar = NavigationToolbar2QT(canvas, parent, False) | ||
toolbar = NavigationToolbar2QT(canvas, parent, True) | ||
elif matplotlib.rcParams['toolbar'] == 'toolmanager': | ||
toolbar = ToolbarQt(self.toolmanager, self.window) | ||
else: | ||
|
@@ -679,7 +677,7 @@ def __init__(self, canvas, parent, coordinates=True): | |
if self.coordinates: | ||
self.locLabel = QtWidgets.QLabel("", self) | ||
self.locLabel.setAlignment( | ||
QtCore.Qt.AlignRight | QtCore.Qt.AlignTop) | ||
QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) | ||
self.locLabel.setSizePolicy( | ||
QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, | ||
QtWidgets.QSizePolicy.Ignored)) | ||
|
Uh oh!
There was an error while loading. Please reload this page.