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 <[email protected]>
  • Loading branch information
CarlSchwan committed Jan 17, 2025
1 parent 4a99ee2 commit c618c49
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions NEXTCLOUD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ option(ENFORCE_SINGLE_ACCOUNT "Enforce use of a single account in desktop client
option( DO_NOT_USE_PROXY "Do not use system wide proxy, instead always do a direct connection to server" OFF )

## Theming options
set(NEXTCLOUD_BACKGROUND_COLOR "#0082c9" CACHE STRING "Default Nextcloud background color")
set(NEXTCLOUD_BACKGROUND_COLOR 0x0082c9 CACHE STRING "Default Nextcloud background color")
set( APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR ${NEXTCLOUD_BACKGROUND_COLOR} CACHE STRING "Hex color of the wizard header background")
set( APPLICATION_WIZARD_HEADER_TITLE_COLOR "#ffffff" CACHE STRING "Hex color of the text in the wizard header")
set( APPLICATION_WIZARD_HEADER_TITLE_COLOR 0xffffff CACHE STRING "Hex color of the text in the wizard header")
option( APPLICATION_WIZARD_USE_CUSTOM_LOGO "Use the logo from ':/client/theme/colored/wizard_logo.(png|svg)' else the default application icon is used" ON )


Expand Down
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 c618c49

Please sign in to comment.