Skip to content

Commit

Permalink
Nicer shading of shutting down overlay in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed May 4, 2024
1 parent c9a4c4b commit af0433e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/calibre/gui2/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from qt.core import (
QActionGroup,
QApplication,
QCoreApplication,
QFrame,
QHBoxLayout,
Expand Down Expand Up @@ -357,10 +358,13 @@ def init_main_window_mixin(self):
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_()
Expand Down

0 comments on commit af0433e

Please sign in to comment.