From 6015ed133adb57b417181f81403bc507b9beb422 Mon Sep 17 00:00:00 2001 From: Lorenz Haas Date: Thu, 23 Jun 2016 19:26:44 +0200 Subject: [PATCH] Utils: Allow named colors for theme's palette section This change allows color definitions like [Palette] a=ffff0000 b=a with some restrictions: - the name "style" results in QColor() (behavior change) - the named color must be alphabetical less than the key (due to QSettings::allKeys()) Change-Id: Idaa8569ce1e5b8502d287fd42b0ee7b75dc8b5d6 Reviewed-by: Alessandro Portale Reviewed-by: Orgad Shaneh --- src/libs/utils/theme/theme.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/theme/theme.cpp b/src/libs/utils/theme/theme.cpp index cf730739c37..7195cab29d3 100644 --- a/src/libs/utils/theme/theme.cpp +++ b/src/libs/utils/theme/theme.cpp @@ -182,10 +182,8 @@ void Theme::readSettings(QSettings &settings) } { settings.beginGroup(QLatin1String("Palette")); - foreach (const QString &key, settings.allKeys()) { - QColor c = readColor(settings.value(key).toString()); - d->palette[key] = c; - } + foreach (const QString &key, settings.allKeys()) + d->palette[key] = readNamedColor(settings.value(key).toString()).first; settings.endGroup(); } {