StyleSheetLoader: Add back alternate base color handling

This commit is contained in:
Jonas Kvinge
2025-06-23 20:43:12 +02:00
parent 5b9bb3efa7
commit d280e6426f

View File

@@ -79,6 +79,11 @@ void StyleSheetLoader::UpdateStyleSheet(QWidget *widget, SharedPtr<StyleSheetDat
// Replace %palette-role with actual colours
QPalette p(widget->palette());
{
const QColor color_altbase = p.color(QPalette::AlternateBase);
stylesheet.replace("%palette-alternate-base"_L1, QStringLiteral("rgba(%1,%2,%3,%4)").arg(color_altbase.red()).arg(color_altbase.green()).arg(color_altbase.blue()).arg(color_altbase.alpha()));
}
ReplaceColor(&stylesheet, u"Window"_s, p, QPalette::Window);
ReplaceColor(&stylesheet, u"Background"_s, p, QPalette::Window);
ReplaceColor(&stylesheet, u"WindowText"_s, p, QPalette::WindowText);