From af0433edb3ce25a7a653ca9b9285ea9a18343327 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 4 May 2024 10:30:50 +0530 Subject: [PATCH] Nicer shading of shutting down overlay in dark mode --- src/calibre/gui2/layout.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/layout.py b/src/calibre/gui2/layout.py index 86b85ccfb7..33c93b5a2f 100644 --- a/src/calibre/gui2/layout.py +++ b/src/calibre/gui2/layout.py @@ -9,6 +9,7 @@ from functools import partial from qt.core import ( QActionGroup, + QApplication, QCoreApplication, QFrame, QHBoxLayout, @@ -357,10 +358,13 @@ class MainWindowMixin: # {{{ smw.setAlignment(Qt.AlignmentFlag.AlignCenter) smw.setVisible(False) smw.setAutoFillBackground(True) - smw.setStyleSheet('QLabel { background-color: rgba(200, 200, 200, 200); color: black }') def show_shutdown_message(self, message=''): smw = self.shutdown_message_widget + bg, fg = 200, 'black' + if QApplication.instance().is_dark_theme: + bg, fg = 30, 'lightgray' + smw.setStyleSheet(f'QLabel {{ background-color: rgba({bg}, {bg}, {bg}, 200); color: {fg} }}') smw.setGeometry(0, 0, self.width(), self.height()) smw.setVisible(True) smw.raise_()