From 3514c3cd82d426dbe4807bcb428a0a8e0b15ed53 Mon Sep 17 00:00:00 2001 From: Yaman Qalieh Date: Wed, 17 Feb 2021 13:37:28 -0500 Subject: [PATCH] Allow setting custom color picker in userColors --- src/utils/confighandler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp index 541ea3cc..72e855dd 100644 --- a/src/utils/confighandler.cpp +++ b/src/utils/confighandler.cpp @@ -101,6 +101,8 @@ QVector ConfigHandler::getUserColors() m_settings.value(QStringLiteral("userColors")).toStringList()) { if (QColor::isValidColor(hex)) { colors.append(QColor(hex)); + } else if (hex == QStringLiteral("picker")) { + colors.append(QColor()); } } @@ -119,7 +121,11 @@ void ConfigHandler::setUserColors(const QVector& l) QStringList hexColors; for (const QColor& color : l) { - hexColors.append(color.name()); + if (color.isValid()) { + hexColors.append(color.name()); + } else { + hexColors.append(QStringLiteral("picker")); + } } m_settings.setValue(QStringLiteral("userColors"),