From 25bb720f095b8fa68656309dec8d6fc7d03fe909 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 2 Nov 2016 22:49:33 +0100 Subject: [PATCH] Bound maximum size for prompts --- qutebrowser/mainwindow/mainwindow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index 248f9a68e..8ed6a19a2 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -240,17 +240,19 @@ class MainWindow(QWidget): width = size_hint.width() left = (self.width() - size_hint.width()) / 2 if centered else 0 + max_height_padding = 20 status_position = config.get('ui', 'status-position') if status_position == 'bottom': top = self.height() - self.status.height() - size_hint.height() top = qtutils.check_overflow(top, 'int', fatal=False) - topleft = QPoint(left, top) + topleft = QPoint(left, max(max_height_padding, top)) bottomright = QPoint(left + width, self.status.geometry().top()) elif status_position == 'top': topleft = QPoint(left, self.status.geometry().bottom()) bottom = self.status.height() + size_hint.height() bottom = qtutils.check_overflow(bottom, 'int', fatal=False) - bottomright = QPoint(width, bottom) + bottomright = QPoint(width, + min(self.height() - max_height_padding, bottom)) else: raise ValueError("Invalid position {}!".format(status_position))