Fix #2069317 [Background colour of the cover grid only changes after a restart](https://bugs.launchpad.net/calibre/+bug/2069317)

This commit is contained in:
Kovid Goyal 2024-06-16 15:42:20 +05:30
parent dcc2078675
commit 2bc1b4018c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -878,9 +878,10 @@ class GridView(QListView):
r, g, b = gprefs['cover_grid_color']
tex = gprefs['cover_grid_texture']
pal = self.palette()
pal.setColor(QPalette.ColorRole.Base, QColor(r, g, b))
bgcol = QColor(r, g, b)
pal.setColor(QPalette.ColorRole.Base, bgcol)
self.setPalette(pal)
ss = ''
ss = f'background-color: {bgcol.name()}; '
if tex:
from calibre.gui2.preferences.texture_chooser import texture_path
path = texture_path(tex)