Skip to content

Commit 20db586

Browse files
tacaswellMeeseeksDev[bot]
authored andcommitted
Backport PR #15613: Revert "Don't bother with manually resizing the Qt main window."
1 parent c629a21 commit 20db586

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,16 @@ def __init__(self, canvas, num):
572572
statusbar_label = QtWidgets.QLabel()
573573
self.window.statusBar().addWidget(statusbar_label)
574574
self.toolbar.message.connect(statusbar_label.setText)
575+
tbs_height = self.toolbar.sizeHint().height()
576+
else:
577+
tbs_height = 0
578+
579+
# resize the main window so it will display the canvas with the
580+
# requested size:
581+
cs = canvas.sizeHint()
582+
sbs = self.window.statusBar().sizeHint()
583+
height = cs.height() + tbs_height + sbs.height()
584+
self.window.resize(cs.width(), height)
575585

576586
self.window.setCentralWidget(self.canvas)
577587

0 commit comments

Comments
 (0)