diff options
author | Lorenz Haas <lorenz.haas@histomatics.de> | 2016-06-23 19:26:44 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2016-07-05 17:19:54 +0000 |
commit | 6015ed133adb57b417181f81403bc507b9beb422 (patch) | |
tree | 5ab26c2e9c24859301c7983f51643e91dcf67a99 /src/libs/utils/theme | |
parent | 96d04570c8f59acd23a6c3ae6d53d11aa3816e42 (diff) | |
download | qt-creator-6015ed133adb57b417181f81403bc507b9beb422.tar.gz |
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 <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/utils/theme')
-rw-r--r-- | src/libs/utils/theme/theme.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libs/utils/theme/theme.cpp b/src/libs/utils/theme/theme.cpp index cf730739c3..7195cab29d 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(); } { |