From bacec50837f713c7d897bb97fe77526cc2b9fdd2 Mon Sep 17 00:00:00 2001 From: Urban Wallasch Date: Thu, 20 May 2021 21:01:45 +0200 Subject: [PATCH] * Removed configurable application style sheets, let the theme decide. --- ffpreview.conf.sample | 12 ------------ ffpreview.py | 10 +++++----- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/ffpreview.conf.sample b/ffpreview.conf.sample index 76937ba..fee0f51 100644 --- a/ffpreview.conf.sample +++ b/ffpreview.conf.sample @@ -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 diff --git a/ffpreview.py b/ffpreview.py index b65ce5f..e6177b2 100755 --- a/ffpreview.py +++ b/ffpreview.py @@ -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() -- 2.30.2