* Removed configurable application style sheets, let the theme decide.
authorUrban Wallasch <urban.wallasch@freenet.de>
Thu, 20 May 2021 19:01:45 +0000 (21:01 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Thu, 20 May 2021 19:01:45 +0000 (21:01 +0200)
ffpreview.conf.sample
ffpreview.py

index 76937ba9dd447820ade469ab53f47dfaa69ae781..fee0f51012e0e48d34db28613879d3f54847e011 100644 (file)
@@ -27,18 +27,6 @@ thumb_width=192
 # Initial thumbnail grid geometry, format: Columns[xRows].
 grid=5x4
 
-# Application and selected thumbnail style in basic CSS syntax.
-# Examples:
-#  Standard theme example:
-#   appstyle=
-#   selstyle=background-color: lightblue;
-#  Dark theme example:
-#   appstyle= * {background-color: #181818; color: #b0b0b0;}
-#             :selected {background-color: #4a90d9; color: #f4f8fd;}
-#   selstyle= background-color: #4a90d9; color: #f4f8fd;
-appstyle=
-selstyle=background-color: lightblue;
-
 # Path to ffprobe executable.
 ffprobe=ffprobe
 
index b65ce5fd44b5b31d2c41dc7f7896e781cef388d1..e6177b23755ec15876d73591dcfcace813322b62 100755 (executable)
@@ -138,8 +138,6 @@ class ffConfig:
         'grid_columns': 5,
         'grid_rows': 4,
         'thumb_width': '192',
-        'appstyle': '',
-        'selstyle': 'background-color: lightblue;',
         'ffprobe': 'ffprobe',
         'ffmpeg': 'ffmpeg',
         'player': 'mpv --no-ordered-chapters --start=%t %f',
@@ -776,9 +774,12 @@ class sMainWindow(QMainWindow):
             self.cur = 0
             return
         try:
-            self.tlabels[self.cur].setStyleSheet('QLabel {}')
+            self.tlabels[self.cur].setStyleSheet('')
+            bg_hl = self.palette().highlight().color().name()
+            fg_hl = self.palette().highlightedText().color().name()
+            style_hl = 'QLabel {background-color: %s; color: %s;}' % (bg_hl, fg_hl)
             self.cur = min(max(0, self.cur if idx is None else idx), l - 1)
-            self.tlabels[self.cur].setStyleSheet( 'QLabel {' + cfg['selstyle'] + '}' )
+            self.tlabels[self.cur].setStyleSheet(style_hl)
             self.statdsp[3].setText('%d / %d' % (self.tlabels[self.cur].info[0], l))
             self.scroll.ensureWidgetVisible(self.tlabels[self.cur], 0, 0)
         except:
@@ -900,7 +901,6 @@ class sMainWindow(QMainWindow):
         self.setWindowTitle(title)
         self.setWindowIcon(ffIcon.ffpreview)
         self.resize(500, 300)
-        self.setStyleSheet(cfg['appstyle'])
         self.clipboard = QApplication.clipboard()
         # set up status bar
         statbar = QHBoxLayout()