Skip to content

Commit

Permalink
Avoid converting string to color
Browse files Browse the repository at this point in the history
Use hex directly

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
  • Loading branch information
CarlSchwan authored and claucambra committed Jan 22, 2025
1 parent f8a6eb2 commit bc3dcee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ void AccountSettings::showConnectionLabel(const QString &message, QStringList er
errors.prepend(message);
auto userFriendlyMsg = errors.join(QLatin1String("<br>"));
qCDebug(lcAccountSettings) << userFriendlyMsg;
Theme::replaceLinkColorString(userFriendlyMsg, QColor("#c1c8e6"));
Theme::replaceLinkColorString(userFriendlyMsg, QColor(0xc1c8e6));
_ui->connectLabel->setText(userFriendlyMsg);
_ui->connectLabel->setToolTip({});
_ui->connectLabel->setStyleSheet(errStyle);
Expand Down
4 changes: 2 additions & 2 deletions src/libsync/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit bc3dcee

Please sign in to comment.