Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c741bd

Browse files
committed
Don't enlarge toolbar for Qt high-dpi.
Can be tested on a non-high-dpi setup by setting e.g. QT_SCALE_FACTOR=2.
1 parent c19ebd6 commit 9c741bd

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

lib/matplotlib/backends/backend_qt5.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -710,13 +710,6 @@ def _init_toolbar(self):
710710
labelAction = self.addWidget(self.locLabel)
711711
labelAction.setVisible(True)
712712

713-
# Esthetic adjustments - we need to set these explicitly in PyQt5
714-
# otherwise the layout looks different - but we don't want to set it if
715-
# not using HiDPI icons otherwise they look worse than before.
716-
if is_pyqt5() and self.canvas._dpi_ratio > 1:
717-
self.setIconSize(QtCore.QSize(24, 24))
718-
self.layout().setSpacing(12)
719-
720713
@cbook.deprecated("3.1")
721714
@property
722715
def buttons(self):
@@ -727,15 +720,6 @@ def buttons(self):
727720
def adj_window(self):
728721
return None
729722

730-
def sizeHint(self):
731-
size = super().sizeHint()
732-
if is_pyqt5() and self.canvas._dpi_ratio > 1:
733-
# For some reason, self.setMinimumHeight doesn't seem to carry over
734-
# to the actual sizeHint, so override it instead in order to make
735-
# the aesthetic adjustments noted above.
736-
size.setHeight(max(48, size.height()))
737-
return size
738-
739723
def edit_parameters(self):
740724
axes = self.canvas.figure.get_axes()
741725
if not axes:

0 commit comments

Comments
 (0)