Skip to content

Commit

Permalink
Constexprify yellow warning colours in FolderWizard
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Sep 14, 2023
1 parent fcff33a commit bce9bd6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gui/folderwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@

#include <cstdlib>

namespace
{
constexpr QColor darkWarnYellow(63, 63, 0);
constexpr QColor lightWarnYellow(255, 255, 192);
}

namespace OCC {

QString FormatWarningsWizardPage::formatWarnings(const QStringList &warnings) const
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bce9bd6

Please sign in to comment.