From 0f5391c4fa447f6f378ea12354e3950f9d1c3873 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Mar 2015 07:50:05 +0100 Subject: [PATCH] Scroll completion to top when showing it. See #531. --- qutebrowser/completion/completionwidget.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index d3b357a5f..64c9ea00d 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -243,6 +243,9 @@ class CompletionView(QTreeView): self._resize_columns() def showEvent(self, e): - """Adjust the completion size when it's freshly shown.""" + """Adjust the completion size and scroll when it's freshly shown.""" self.resize_completion.emit() + scrollbar = self.verticalScrollBar() + if scrollbar is not None: + scrollbar.setValue(scrollbar.minimum()) super().showEvent(e)