tweak dark palette behavvior bit more precise

This commit is contained in:
Martin Rotter 2023-06-29 11:19:51 +02:00
parent 860ccdb611
commit 649ea75ea8

View File

@ -171,7 +171,8 @@ void SkinFactory::loadSkinFromData(const Skin& skin) {
const bool use_skin_colors = const bool use_skin_colors =
skin.m_forcedSkinColors || qApp->settings()->value(GROUP(GUI), SETTING(GUI::ForcedSkinColors)).toBool(); skin.m_forcedSkinColors || qApp->settings()->value(GROUP(GUI), SETTING(GUI::ForcedSkinColors)).toBool();
if (isStyleGoodForAlternativeStylePalette(m_currentStyle) && !skin.m_stylePalette.isEmpty() && use_skin_colors) { if (isStyleGoodForAlternativeStylePalette(m_currentStyle)) {
if (!skin.m_stylePalette.isEmpty() && use_skin_colors) {
qDebugNN << LOGSEC_GUI << "Activating alternative palette."; qDebugNN << LOGSEC_GUI << "Activating alternative palette.";
QPalette pal = skin.extractPalette(); QPalette pal = skin.extractPalette();
@ -182,14 +183,12 @@ void SkinFactory::loadSkinFromData(const Skin& skin) {
// NOTE: Very hacky way of avoiding automatic "dark mode" // NOTE: Very hacky way of avoiding automatic "dark mode"
// palettes in some styles. Also in light mode, // palettes in some styles. Also in light mode,
// colors are now derived from system. // colors are now derived from system.
//
// NOTE: At this point disabled as it effectively disables automatic "dark
// mode when it is enabled in OS settings.
#if QT_VERSION >= 0x060500 // Qt >= 6.5.0 #if QT_VERSION >= 0x060500 // Qt >= 6.5.0
// else /* if (qApp->styleHints()->colorScheme() == Qt::ColorScheme::Dark) */ { else {
// qApp->setPalette(qt_fusionPalette(false)); qApp->setPalette(qt_fusionPalette(qApp->styleHints()->colorScheme() == Qt::ColorScheme::Dark));
// } }
#endif #endif
}
if (!skin.m_rawData.isEmpty()) { if (!skin.m_rawData.isEmpty()) {
if (qApp->styleSheet().simplified().isEmpty() && use_skin_colors) { if (qApp->styleSheet().simplified().isEmpty() && use_skin_colors) {