From 8d16daab6e098d86ce21ce3030e06e98ccd5294e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 Nov 2020 11:59:53 +0530 Subject: [PATCH] Viewer: In dark mode when showing images with transparency in the popup use a light background color as most images are designed with a light background color in mind. Fixes #1903423 [ebook-viewer: Transparent PNG renders strangely in dark mode viewer](https://bugs.launchpad.net/calibre/+bug/1903423) --- src/calibre/gui2/image_popup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/image_popup.py b/src/calibre/gui2/image_popup.py index b582c1c221..4acc4f26ab 100644 --- a/src/calibre/gui2/image_popup.py +++ b/src/calibre/gui2/image_popup.py @@ -47,7 +47,7 @@ class ImageView(QDialog): self.geom_name = geom_name self.label = l = QLabel(self) - l.setBackgroundRole(QPalette.Base) + l.setBackgroundRole(QPalette.Text if QApplication.instance().is_dark_theme else QPalette.Base) l.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) l.setScaledContents(True)