Rename max_height_padding
This commit is contained in:
parent
a006ecffec
commit
59b4ccc620
@ -235,19 +235,19 @@ class MainWindow(QWidget):
|
|||||||
width = size_hint.width()
|
width = size_hint.width()
|
||||||
left = (self.width() - size_hint.width()) / 2 if centered else 0
|
left = (self.width() - size_hint.width()) / 2 if centered else 0
|
||||||
|
|
||||||
max_height_padding = 20
|
height_padding = 20
|
||||||
status_position = config.get('ui', 'status-position')
|
status_position = config.get('ui', 'status-position')
|
||||||
if status_position == 'bottom':
|
if status_position == 'bottom':
|
||||||
top = self.height() - self.status.height() - size_hint.height()
|
top = self.height() - self.status.height() - size_hint.height()
|
||||||
top = qtutils.check_overflow(top, 'int', fatal=False)
|
top = qtutils.check_overflow(top, 'int', fatal=False)
|
||||||
topleft = QPoint(left, max(max_height_padding, top))
|
topleft = QPoint(left, max(height_padding, top))
|
||||||
bottomright = QPoint(left + width, self.status.geometry().top())
|
bottomright = QPoint(left + width, self.status.geometry().top())
|
||||||
elif status_position == 'top':
|
elif status_position == 'top':
|
||||||
topleft = QPoint(left, self.status.geometry().bottom())
|
topleft = QPoint(left, self.status.geometry().bottom())
|
||||||
bottom = self.status.height() + size_hint.height()
|
bottom = self.status.height() + size_hint.height()
|
||||||
bottom = qtutils.check_overflow(bottom, 'int', fatal=False)
|
bottom = qtutils.check_overflow(bottom, 'int', fatal=False)
|
||||||
bottomright = QPoint(left + width,
|
bottomright = QPoint(left + width,
|
||||||
min(self.height() - max_height_padding, bottom))
|
min(self.height() - height_padding, bottom))
|
||||||
else:
|
else:
|
||||||
raise ValueError("Invalid position {}!".format(status_position))
|
raise ValueError("Invalid position {}!".format(status_position))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user