From: Urban Wallasch Date: Fri, 14 May 2021 17:24:22 +0000 (+0200) Subject: * Added config file options 'appstyle' and 'selstyle' to allow for more flexible... X-Git-Tag: v0.3~54 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=dc9c1bd20f4fc5b322031087d004baef0536b665;p=ffpreview.git * Added config file options 'appstyle' and 'selstyle' to allow for more flexible application styling. --- diff --git a/ffpreview.conf.sample b/ffpreview.conf.sample index c9d7741..bf8bc5b 100644 --- a/ffpreview.conf.sample +++ b/ffpreview.conf.sample @@ -12,9 +12,16 @@ thumb_width=128 # Initial thumbnail grid geometry, columns [x rows]. grid=5x5 -# Mouse-over thumbnail highlight color. Either a color name or in a -# hexadecimal color specifier in #RRGGBB notation. -highlightcolor=lightblue +# Application and selected thumbnail style in CSS syntax. +# Examples: +# default theme +# appstyle= +# selstyle=background-color: lightblue; +# dark theme +# appstyle=background-color: #181818; color: #a0a0a0; +# selstyle=background-color: #b0b0b0; color: #202020; +appstyle= +selstyle=background-color: lightblue; # Path to ffprobe. ffprobe=ffprobe diff --git a/ffpreview.py b/ffpreview.py index ff88434..6ff4726 100755 --- a/ffpreview.py +++ b/ffpreview.py @@ -108,7 +108,8 @@ def configure(): 'grid_columns': 5, 'grid_rows': 5, 'thumb_width': '128', - 'highlightcolor': 'lightblue', + 'appstyle': '', + 'selstyle': 'background-color: lightblue;', 'ffprobe': 'ffprobe', 'ffmpeg': 'ffmpeg', 'player': 'mpv --no-ordered-chapters --start=%t %f', @@ -532,7 +533,7 @@ class sMainWindow(QMainWindow): elif idx >= len(l): idx = len(l) - 1 self.cur = idx - l[self.cur].setStyleSheet('QLabel {background-color: %s;}' % cfg['highlightcolor']) + l[self.cur].setStyleSheet( 'QLabel {' + cfg['selstyle'] + '}' ) self.statdsp[3].setText('%d / %d' % (l[self.cur].info[0], self.thinfo['count'])) self.scroll.ensureWidgetVisible(l[self.cur], 0, 0) @@ -560,6 +561,7 @@ class sMainWindow(QMainWindow): self.setWindowIcon(self.ffpreview_ico) self.clipboard = QApplication.clipboard() self.resize(500, 300) + self.setStyleSheet(cfg['appstyle']) self.statbar = QHBoxLayout() self.statdsp = []