mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 09:33:57 -07:00
Use fusions own palette.
Took 6 minutes
This commit is contained in:
parent
3ec9ae9772
commit
4cc324e1f1
1 changed files with 5 additions and 3 deletions
|
|
@ -332,13 +332,15 @@ void ThemeManager::themeChangedSlot()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (themeName == FUSION_THEME_NAME) {
|
if (themeName == FUSION_THEME_NAME) {
|
||||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
QStyle *fusionStyle = QStyleFactory::create("Fusion");
|
||||||
|
qApp->setStyle(fusionStyle);
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
||||||
QPalette palette;
|
// Start from Fusion's own palette so dark mode is handled correctly,
|
||||||
|
// then apply any tweaks on top of it.
|
||||||
|
QPalette palette = fusionStyle->standardPalette();
|
||||||
if (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark) {
|
if (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark) {
|
||||||
palette.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
|
palette.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
|
||||||
}
|
}
|
||||||
|
|
||||||
qApp->setPalette(palette);
|
qApp->setPalette(palette);
|
||||||
#endif
|
#endif
|
||||||
} else if (themeName == FUSION_THEME_NAME_LIGHT) {
|
} else if (themeName == FUSION_THEME_NAME_LIGHT) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue