Cleanup
This commit is contained in:
parent
ac43a0b5cb
commit
4dc33102b7
@ -134,12 +134,11 @@ class DownloadItem(QObject):
|
||||
return None
|
||||
return (self.bytes_total - self.bytes_done) / self.speed
|
||||
|
||||
|
||||
def bg_color(self):
|
||||
"""Background color to be shown."""
|
||||
start = config.get('colors', 'download.bg.start')
|
||||
stop = config.get('colors', 'download.bg.stop')
|
||||
system = config.get('colors', 'download.bg.system')
|
||||
start = config.get('colors', 'downloads.bg.start')
|
||||
stop = config.get('colors', 'downloads.bg.stop')
|
||||
system = config.get('colors', 'downloads.bg.system')
|
||||
if self.percentage is None:
|
||||
return start
|
||||
else:
|
||||
|
@ -895,23 +895,23 @@ DATA = OrderedDict([
|
||||
'color-stop(100%,#FFC542))'),
|
||||
"Background color for hints."),
|
||||
|
||||
('download.fg',
|
||||
('downloads.fg',
|
||||
SettingValue(types.QtColor(), '#ffffff'),
|
||||
"Foreground color for downloads."),
|
||||
|
||||
('download.bg.bar',
|
||||
('downloads.bg.bar',
|
||||
SettingValue(types.Color(), '#555555'),
|
||||
"Background color for the download bar."),
|
||||
|
||||
('download.bg.start',
|
||||
('downloads.bg.start',
|
||||
SettingValue(types.QtColor(), '#0000aa'),
|
||||
"Color gradient start for downloads."),
|
||||
|
||||
('download.bg.stop',
|
||||
('downloads.bg.stop',
|
||||
SettingValue(types.QtColor(), '#00aa00'),
|
||||
"Color gradient end for downloads."),
|
||||
|
||||
('download.bg.system',
|
||||
('downloads.bg.system',
|
||||
SettingValue(types.ColorSystem(), 'rgb'),
|
||||
"Color gradient interpolation system for downloads."),
|
||||
)),
|
||||
@ -936,7 +936,7 @@ DATA = OrderedDict([
|
||||
SettingValue(types.Font(), '8pt ${_monospace}'),
|
||||
"Font used in the statusbar."),
|
||||
|
||||
('download',
|
||||
('downloads',
|
||||
SettingValue(types.Font(), '8pt ${_monospace}'),
|
||||
"Font used for the downloadbar."),
|
||||
|
||||
|
@ -71,7 +71,7 @@ class DownloadModel(QAbstractListModel):
|
||||
if role == Qt.DisplayRole:
|
||||
data = str(item)
|
||||
elif role == Qt.ForegroundRole:
|
||||
data = config.get('colors', 'download.fg')
|
||||
data = config.get('colors', 'downloads.fg')
|
||||
elif role == Qt.BackgroundRole:
|
||||
data = item.bg_color()
|
||||
else:
|
||||
|
@ -30,8 +30,8 @@ class DownloadView(QListView):
|
||||
|
||||
STYLESHEET = """
|
||||
QListView {{
|
||||
{color[download.bg.bar]}
|
||||
{font[download]}
|
||||
{color[downloads.bg.bar]}
|
||||
{font[downloads]}
|
||||
}}
|
||||
"""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user