Skip to content

Commit d9b5b6f

Browse files
tacaswellMeeseeksDev[bot]
authored andcommitted
Backport PR matplotlib#14697: Fix NavigationToolbar2QT height
1 parent 9a5473d commit d9b5b6f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -745,14 +745,14 @@ def buttons(self):
745745
def adj_window(self):
746746
return None
747747

748-
if is_pyqt5():
749-
# For some reason, self.setMinimumHeight doesn't seem to carry over to
750-
# the actual sizeHint, so override it instead in order to make the
751-
# aesthetic adjustments noted above.
752-
def sizeHint(self):
753-
size = super().sizeHint()
748+
def sizeHint(self):
749+
size = super().sizeHint()
750+
if is_pyqt5() and self.canvas._dpi_ratio > 1:
751+
# For some reason, self.setMinimumHeight doesn't seem to carry over
752+
# to the actual sizeHint, so override it instead in order to make
753+
# the aesthetic adjustments noted above.
754754
size.setHeight(max(48, size.height()))
755-
return size
755+
return size
756756

757757
def edit_parameters(self):
758758
axes = self.canvas.figure.get_axes()

0 commit comments

Comments
 (0)