8000 Backport PR #15613 on branch v3.2.x (Revert "Don't bother with manually resizing the Qt main window.") by meeseeksmachine · Pull Request #15618 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backport PR #15613 on branch v3.2.x (Revert "Don't bother with manually resizing the Qt main window.") #15618

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
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
10 changes: 10 additions & 0 deletions lib/matplotlib/backends/backend_qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,16 @@ def __init__(self, canvas, num):
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()
self.window.resize(cs.width(), height)

self.window.setCentralWidget(self.canvas)

Expand Down
0