mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Nicer shading of shutting down overlay in dark mode
This commit is contained in:
parent
c9a4c4b2a0
commit
af0433edb3
@ -9,6 +9,7 @@ from functools import partial
|
|||||||
|
|
||||||
from qt.core import (
|
from qt.core import (
|
||||||
QActionGroup,
|
QActionGroup,
|
||||||
|
QApplication,
|
||||||
QCoreApplication,
|
QCoreApplication,
|
||||||
QFrame,
|
QFrame,
|
||||||
QHBoxLayout,
|
QHBoxLayout,
|
||||||
@ -357,10 +358,13 @@ class MainWindowMixin: # {{{
|
|||||||
smw.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
smw.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||||
smw.setVisible(False)
|
smw.setVisible(False)
|
||||||
smw.setAutoFillBackground(True)
|
smw.setAutoFillBackground(True)
|
||||||
smw.setStyleSheet('QLabel { background-color: rgba(200, 200, 200, 200); color: black }')
|
|
||||||
|
|
||||||
def show_shutdown_message(self, message=''):
|
def show_shutdown_message(self, message=''):
|
||||||
smw = self.shutdown_message_widget
|
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.setGeometry(0, 0, self.width(), self.height())
|
||||||
smw.setVisible(True)
|
smw.setVisible(True)
|
||||||
smw.raise_()
|
smw.raise_()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user