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

Skip to content

Commit bb6a4af

Browse files
authored
Merge pull request #14702 from anntzer/qtnavbarhighdpi
MNT: Don't enlarge toolbar for Qt high-dpi.
2 parents b49ca9d + 9c741bd commit bb6a4af

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
@@ -724,13 +724,6 @@ def _init_toolbar(self):
724724
labelAction = self.addWidget(self.locLabel)
725725
labelAction.setVisible(True)
726726

727-
# Esthetic adjustments - we need to set these explicitly in PyQt5
728-
# otherwise the layout looks different - but we don't want to set it if
729-
# not using HiDPI icons otherwise they look worse than before.
730-
if is_pyqt5() and self.canvas._dpi_ratio > 1:
731-
self.setIconSize(QtCore.QSize(24, 24))
732-
self.layout().setSpacing(12)
733-
734727
@cbook.deprecated("3.1")
735728
@property
736729
def buttons(self):
@@ -741,15 +734,6 @@ def buttons(self):
741734
def adj_window(self):
742735
return None
743736

744-
def sizeHint(self):
745-
size = super().sizeHint()
746-
if is_pyqt5() and self.canvas._dpi_ratio > 1:
747-
# For some reason, self.setMinimumHeight doesn't seem to carry over
748-
# to the actual sizeHint, so override it instead in order to make
749-
# the aesthetic adjustments noted above.
750-
size.setHeight(max(48, size.height()))
751-
return size
752-
753737
def edit_parameters(self):
754738
axes = self.canvas.figure.get_axes()
755739
if not axes:

0 commit comments

Comments
 (0)