Style DownloadView

This commit is contained in:
Florian Bruhin 2014-06-13 07:39:47 +02:00
parent 9b7ff910c3
commit ac43a0b5cb
2 changed files with 17 additions and 0 deletions

View File

@ -899,6 +899,10 @@ DATA = OrderedDict([
SettingValue(types.QtColor(), '#ffffff'),
"Foreground color for downloads."),
('download.bg.bar',
SettingValue(types.Color(), '#555555'),
"Background color for the download bar."),
('download.bg.start',
SettingValue(types.QtColor(), '#0000aa'),
"Color gradient start for downloads."),
@ -932,6 +936,10 @@ DATA = OrderedDict([
SettingValue(types.Font(), '8pt ${_monospace}'),
"Font used in the statusbar."),
('download',
SettingValue(types.Font(), '8pt ${_monospace}'),
"Font used for the downloadbar."),
('hints',
SettingValue(types.Font(), 'bold 12px Monospace'),
"Font used for the hints."),

View File

@ -21,14 +21,23 @@ from PyQt5.QtCore import QSize
from PyQt5.QtWidgets import QListView, QSizePolicy
from qutebrowser.models.downloadmodel import DownloadModel
from qutebrowser.config.style import set_register_stylesheet
class DownloadView(QListView):
"""QListView which shows currently running downloads as a bar."""
STYLESHEET = """
QListView {{
{color[download.bg.bar]}
{font[download]}
}}
"""
def __init__(self, parent=None):
super().__init__(parent)
set_register_stylesheet(self)
self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
self.setFlow(QListView.LeftToRight)
self._model = DownloadModel()