kcms/colors: handle the "transparent" value explicitly

wilder-5.26
Tanbir Jishan 4 years ago committed by Fushan Wen
parent ad00948ff3
commit acea9036c1
  1. 10
      kcms/colors/colorsapplicator.cpp

@ -126,13 +126,17 @@ void applyScheme(const QString &colorSchemePath, KConfig *configOutput, KConfig:
KSharedConfigPtr globalConfig = KSharedConfig::openConfig(QStringLiteral("kdeglobals"));
globalConfig->sync();
const auto hasAccent = [globalConfig]() {
return globalConfig->group("General").hasKey("AccentColor");
};
const auto getAccent = [globalConfig]() {
return globalConfig->group("General").readEntry<QColor>("AccentColor", QColor());
};
const auto hasAccent = [globalConfig, &getAccent]() {
if (getAccent() == QColor(Qt::transparent)) {
return false;
}
return globalConfig->group("General").hasKey("AccentColor");
};
// Using KConfig::SimpleConfig because otherwise Header colors won't be
// rewritten when a new color scheme is loaded.
KSharedConfigPtr config = KSharedConfig::openConfig(colorSchemePath, KConfig::SimpleConfig);

Loading…
Cancel
Save