This commit is contained in:
Kovid Goyal 2020-07-26 13:40:48 +05:30
parent 1558b858a6
commit 835a71e39d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -811,8 +811,9 @@ class GridView(QListView):
val = pm.scaled(1, 1).toImage().pixel(0, 0) val = pm.scaled(1, 1).toImage().pixel(0, 0)
r, g, b = qRed(val), qGreen(val), qBlue(val) r, g, b = qRed(val), qGreen(val), qBlue(val)
dark = max(r, g, b) < 115 dark = max(r, g, b) < 115
ss += 'color: {};'.format('white' if dark else 'black') col = '#eee' if dark else '#111'
self.delegate.highlight_color = QColor(Qt.white if dark else Qt.black) ss += 'color: {};'.format(col)
self.delegate.highlight_color = QColor(col)
self.setStyleSheet('QListView {{ {} }}'.format(ss)) self.setStyleSheet('QListView {{ {} }}'.format(ss))
def refresh_settings(self): def refresh_settings(self):