From bce9bd649ab562ca1fad8ef6e554e9bfead544db Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 23 Aug 2023 09:06:42 +0800 Subject: [PATCH] Constexprify yellow warning colours in FolderWizard Signed-off-by: Claudio Cambra --- src/gui/folderwizard.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index 715e01a3a5f27..d9332aca0c70c 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -41,6 +41,12 @@ #include +namespace +{ +constexpr QColor darkWarnYellow(63, 63, 0); +constexpr QColor lightWarnYellow(255, 255, 192); +} + namespace OCC { QString FormatWarningsWizardPage::formatWarnings(const QStringList &warnings) const @@ -162,7 +168,7 @@ void FolderWizardLocalPath::changeEvent(QEvent *e) void FolderWizardLocalPath::changeStyle() { - const auto warnYellow = Theme::instance()->darkMode() ? QColor(63, 63, 0) : QColor(255, 255, 192); + const auto warnYellow = Theme::instance()->darkMode() ? darkWarnYellow : lightWarnYellow; auto modifiedPalette = _ui.warnLabel->palette(); modifiedPalette.setColor(QPalette::Window, warnYellow); modifiedPalette.setColor(QPalette::Base, warnYellow); @@ -544,7 +550,7 @@ void FolderWizardRemotePath::changeEvent(QEvent *e) void FolderWizardRemotePath::changeStyle() { - const auto warnYellow = Theme::instance()->darkMode() ? QColor(63, 63, 0) : QColor(255, 255, 192); + const auto warnYellow = Theme::instance()->darkMode() ? darkWarnYellow : lightWarnYellow; auto modifiedPalette = _ui.warnLabel->palette(); modifiedPalette.setColor(QPalette::Window, warnYellow); modifiedPalette.setColor(QPalette::Base, warnYellow);