From 411f88e0ff1bbc07cc6beae6fa9dbab32db37796 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Fri, 17 Jan 2025 15:10:18 +0100 Subject: [PATCH] Avoid converting string to color Use hex directly Signed-off-by: Carl Schwan --- src/gui/accountsettings.cpp | 2 +- src/libsync/theme.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 47c8793794a4d..6af3208d0269f 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -1140,7 +1140,7 @@ void AccountSettings::showConnectionLabel(const QString &message, QStringList er errors.prepend(message); auto userFriendlyMsg = errors.join(QLatin1String("
")); qCDebug(lcAccountSettings) << userFriendlyMsg; - Theme::replaceLinkColorString(userFriendlyMsg, QColor("#c1c8e6")); + Theme::replaceLinkColorString(userFriendlyMsg, QColor(0xc1c8e6)); _ui->connectLabel->setText(userFriendlyMsg); _ui->connectLabel->setToolTip({}); _ui->connectLabel->setStyleSheet(errStyle); diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 7e717bf05f1be..7850f7ff03abe 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -277,7 +277,7 @@ QIcon Theme::themeIcon(const QString &name, bool sysTray) const if (qgetenv("DESKTOP_SESSION") == "ubuntu") { QBitmap mask = px.createMaskFromColor(Qt::white, Qt::MaskOutColor); QPainter p(&px); - p.setPen(QColor("#dfdbd2")); + p.setPen(QColor(0xdfdbd2)); p.drawPixmap(px.rect(), mask, mask.rect()); } cached.addPixmap(px); @@ -870,7 +870,7 @@ bool Theme::isDarkColor(const QColor &color) QColor Theme::getBackgroundAwareLinkColor(const QColor &backgroundColor) { - return {(isDarkColor(backgroundColor) ? QColor("#6193dc") : QGuiApplication::palette().color(QPalette::Link))}; + return {(isDarkColor(backgroundColor) ? QColor(0x6193dc) : QGuiApplication::palette().color(QPalette::Link))}; } QColor Theme::getBackgroundAwareLinkColor()