1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-15 18:58:55 +01:00

Fix the alternate background colour

This commit is contained in:
David Sansome 2010-03-25 13:38:57 +00:00
parent 06555da965
commit 9adf70d77e

View File

@ -45,12 +45,12 @@ void StyleSheetLoader::UpdateStyleSheet(QWidget *widget) {
// Replace %palette-role with actual colours // Replace %palette-role with actual colours
QPalette p(widget->palette()); QPalette p(widget->palette());
// HACK
QColor alt = p.color(QPalette::AlternateBase); QColor alt = p.color(QPalette::AlternateBase);
alt.setAlpha(50); alt.setAlpha(50);
QString name = QString( contents.replace("%palette-alternate-base", QString("rgba(%1,%2,%3,%4%)")
"qrgba(%1,%2,%3,%4)").arg(alt.red()).arg(alt.green()).arg(alt.blue()).arg(alt.alpha()); .arg(alt.red()).arg(alt.green()).arg(alt.blue()).arg(alt.alpha()));
contents.replace("%palette-alternate-base", name);
ReplaceColor(&contents, "Window", p, QPalette::Window); ReplaceColor(&contents, "Window", p, QPalette::Window);
ReplaceColor(&contents, "Background", p, QPalette::Background); ReplaceColor(&contents, "Background", p, QPalette::Background);
ReplaceColor(&contents, "WindowText", p, QPalette::WindowText); ReplaceColor(&contents, "WindowText", p, QPalette::WindowText);