Fix progressbar height to statusbar height.

Formerly, the statusbar height changed when the progressbar was visible.
This was caused by the default font-size of the progressbar text (though
invisible). Overriding the minimumSizeHint() method ignores the
font-size of the hidden text and the statusbar height does not change
anymore.

This fixes the first issue of #886.
This commit is contained in:
Thorsten Wißmann 2015-08-17 15:22:08 +02:00
parent 1a062035eb
commit 183a5910de

View File

@ -79,5 +79,9 @@ class Progress(QProgressBar):
def sizeHint(self):
"""Set the height to the text height plus some padding."""
width = super().sizeHint().width()
height = self.fontMetrics().height() + 3
height = self.fontMetrics().height()
return QSize(width, height)
def minimumSizeHint(self):
"""Set the height to the text height plus some padding."""
return self.sizeHint()