8000 Merge pull request #7610 from QuLogic/qt5-sizing · matplotlib/matplotlib@163cf66 · GitHub
[go: up one dir, main page]

Skip to content

Commit 163cf66

Browse files
authored
Merge pull request #7610 from QuLogic/qt5-sizing
FIX: Force Qt5 toolbar minimum height to 48.
2 parents 5a3c796 + 1180f3a commit 163cf66

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,15 @@ def _init_toolbar(self):
611611
if is_pyqt5():
612612
self.setIconSize(QtCore.QSize(24, 24))
613613
self.layout().setSpacing(12)
614-
self.setMinimumHeight(48)
614+
615+
if is_pyqt5():
616+
# For some reason, self.setMinimumHeight doesn't seem to carry over to
617+
# the actual sizeHint, so override it instead in order to make the
618+
# aesthetic adjustments noted above.
619+
def sizeHint(self):
620+
size = super().sizeHint()
621+
size.setHeight(max(48, size.height()))
622+
return size
615623

616624
def edit_parameters(self):
617625
allaxes = self.canvas.figure.get_axes()

0 commit comments

Comments
 (0)
0