diff options
author | Ken Moore <ken@ixsystems.com> | 2019-01-15 07:44:51 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2019-01-15 07:44:51 -0500 |
commit | d101fdee54adc076c8e54dd4d6a6239aa1014901 (patch) | |
tree | f96bab28c4d143f51aceaefa85358114b18bdffd /src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin | |
parent | Get lumina-pdf fixed up quite a bit: (diff) | |
download | lumina-d101fdee54adc076c8e54dd4d6a6239aa1014901.tar.gz lumina-d101fdee54adc076c8e54dd4d6a6239aa1014901.tar.bz2 lumina-d101fdee54adc076c8e54dd4d6a6239aa1014901.zip |
Track a Qt change with Qt 5.12:
They added a new color to the QPalette class, which was throwing off the settings-load system.
Make the settings-load system more robust by supporting files which had fewer colors specified (backwards compatible), while also updating the palette editor to add support for the new color.
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin')
-rw-r--r-- | src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp index a6e05000..621aa0ac 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp @@ -310,13 +310,13 @@ QPalette lthemeenginePlatformTheme::loadColorScheme(QString filePath){ QStringList inactiveColors = settings.value("inactive_colors").toStringList(); QStringList disabledColors = settings.value("disabled_colors").toStringList(); settings.endGroup(); - if(activeColors.count() == QPalette::NColorRoles && inactiveColors.count() == QPalette::NColorRoles && disabledColors.count() == QPalette::NColorRoles){ - for (int i = 0; i < QPalette::NColorRoles; i++){ - QPalette::ColorRole role = QPalette::ColorRole(i); - customPalette.setColor(QPalette::Active, role, QColor(activeColors.at(i))); - customPalette.setColor(QPalette::Inactive, role, QColor(inactiveColors.at(i))); - customPalette.setColor(QPalette::Disabled, role, QColor(disabledColors.at(i))); - } + if(activeColors.count() <= QPalette::NColorRoles && inactiveColors.count() <= QPalette::NColorRoles && disabledColors.count() <= QPalette::NColorRoles){ + for (int i = 0; i < QPalette::NColorRoles && i<activeColors.count(); i++){ + QPalette::ColorRole role = QPalette::ColorRole(i); + customPalette.setColor(QPalette::Active, role, QColor(activeColors.at(i))); + customPalette.setColor(QPalette::Inactive, role, QColor(inactiveColors.at(i))); + customPalette.setColor(QPalette::Disabled, role, QColor(disabledColors.at(i))); + } } else{ customPalette = *QPlatformTheme::palette(SystemPalette); } //load fallback palette return customPalette; |