* Added config file options 'appstyle' and 'selstyle' to allow for more flexible...
authorUrban Wallasch <urban.wallasch@freenet.de>
Fri, 14 May 2021 17:24:22 +0000 (19:24 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Fri, 14 May 2021 17:24:22 +0000 (19:24 +0200)
ffpreview.conf.sample
ffpreview.py

index c9d77417197f20caf8e184d683b3d66285456559..bf8bc5b519c129c7de41dc76286d3e57bfb28491 100644 (file)
@@ -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
index ff88434bc797237476e1edff81f2db63f36bcfe0..6ff4726c8221617d17fbc1a343c8187c635f0cde 100755 (executable)
@@ -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 = []