From 70d7a56b1189d2d85da1303a2fbacea57171e324 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 25 Apr 2017 22:13:59 +0200 Subject: [PATCH] Also set Fusion style for downloads and completion This makes those UI elements look the same on different platforms/OS styles, with the small drawback of overriding the context menu style. This most likely fixes #80 (though I couldn't reproduce that on Windows 10). --- qutebrowser/browser/downloadview.py | 3 ++- qutebrowser/completion/completionwidget.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/downloadview.py b/qutebrowser/browser/downloadview.py index 633fd8700..715fe2a54 100644 --- a/qutebrowser/browser/downloadview.py +++ b/qutebrowser/browser/downloadview.py @@ -23,7 +23,7 @@ import functools import sip from PyQt5.QtCore import pyqtSlot, QSize, Qt, QTimer -from PyQt5.QtWidgets import QListView, QSizePolicy, QMenu +from PyQt5.QtWidgets import QListView, QSizePolicy, QMenu, QStyleFactory from qutebrowser.browser import downloads from qutebrowser.config import style @@ -75,6 +75,7 @@ class DownloadView(QListView): def __init__(self, win_id, parent=None): super().__init__(parent) + self.setStyle(QStyleFactory.create('Fusion')) style.set_register_stylesheet(self) self.setResizeMode(QListView.Adjust) self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index 923a67280..e9fad39fd 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -23,7 +23,7 @@ Defines a CompletionView which uses CompletionFiterModel and CompletionModel subclasses to provide completions. """ -from PyQt5.QtWidgets import QStyle, QTreeView, QSizePolicy +from PyQt5.QtWidgets import QStyle, QTreeView, QSizePolicy, QStyleFactory from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QItemSelectionModel, QSize from qutebrowser.config import config, style @@ -117,6 +117,7 @@ class CompletionView(QTreeView): self._delegate = completiondelegate.CompletionItemDelegate(self) self.setItemDelegate(self._delegate) + self.setStyle(QStyleFactory.create('Fusion')) style.set_register_stylesheet(self) self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) self.setHeaderHidden(True)