mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Store default palette before "fusion" QStyle is applied
Once a QStyle different from the system default is applied, the system default palette can no longer be retrieved with standardPalette().
This commit is contained in:
parent
0e3ada4fcf
commit
fa0e3540eb
1 changed files with 2 additions and 0 deletions
|
@ -35,6 +35,7 @@ class ThemeManager:
|
||||||
_icon_cache_dark: Dict[str, QIcon] = {}
|
_icon_cache_dark: Dict[str, QIcon] = {}
|
||||||
_icon_size = 128
|
_icon_size = 128
|
||||||
_dark_mode_available: Optional[bool] = None
|
_dark_mode_available: Optional[bool] = None
|
||||||
|
default_palette: Optional[QPalette] = None
|
||||||
|
|
||||||
# Qt applies a gradient to the buttons in dark mode
|
# Qt applies a gradient to the buttons in dark mode
|
||||||
# from about #505050 to #606060.
|
# from about #505050 to #606060.
|
||||||
|
@ -133,6 +134,7 @@ class ThemeManager:
|
||||||
return QColor(self.color(colors))
|
return QColor(self.color(colors))
|
||||||
|
|
||||||
def apply_style(self, app: QApplication) -> None:
|
def apply_style(self, app: QApplication) -> None:
|
||||||
|
self.default_palette = app.style().standardPalette()
|
||||||
self._apply_palette(app)
|
self._apply_palette(app)
|
||||||
self._apply_style(app)
|
self._apply_style(app)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue