Skip to content

Commit c618c49

Browse files
committed
Avoid converting string to color
Use hex directly Signed-off-by: Carl Schwan <[email protected]>
1 parent 4a99ee2 commit c618c49

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

NEXTCLOUD.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ option(ENFORCE_SINGLE_ACCOUNT "Enforce use of a single account in desktop client
5858
option( DO_NOT_USE_PROXY "Do not use system wide proxy, instead always do a direct connection to server" OFF )
5959

6060
## Theming options
61-
set(NEXTCLOUD_BACKGROUND_COLOR "#0082c9" CACHE STRING "Default Nextcloud background color")
61+
set(NEXTCLOUD_BACKGROUND_COLOR 0x0082c9 CACHE STRING "Default Nextcloud background color")
6262
set( APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR ${NEXTCLOUD_BACKGROUND_COLOR} CACHE STRING "Hex color of the wizard header background")
63-
set( APPLICATION_WIZARD_HEADER_TITLE_COLOR "#ffffff" CACHE STRING "Hex color of the text in the wizard header")
63+
set( APPLICATION_WIZARD_HEADER_TITLE_COLOR 0xffffff CACHE STRING "Hex color of the text in the wizard header")
6464
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 )
6565

6666

src/gui/accountsettings.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ void AccountSettings::showConnectionLabel(const QString &message, QStringList er
11401140
errors.prepend(message);
11411141
auto userFriendlyMsg = errors.join(QLatin1String("<br>"));
11421142
qCDebug(lcAccountSettings) << userFriendlyMsg;
1143-
Theme::replaceLinkColorString(userFriendlyMsg, QColor("#c1c8e6"));
1143+
Theme::replaceLinkColorString(userFriendlyMsg, QColor(0xc1c8e6));
11441144
_ui->connectLabel->setText(userFriendlyMsg);
11451145
_ui->connectLabel->setToolTip({});
11461146
_ui->connectLabel->setStyleSheet(errStyle);

src/libsync/theme.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ QIcon Theme::themeIcon(const QString &name, bool sysTray) const
277277
if (qgetenv("DESKTOP_SESSION") == "ubuntu") {
278278
QBitmap mask = px.createMaskFromColor(Qt::white, Qt::MaskOutColor);
279279
QPainter p(&px);
280-
p.setPen(QColor("#dfdbd2"));
280+
p.setPen(QColor(0xdfdbd2));
281281
p.drawPixmap(px.rect(), mask, mask.rect());
282282
}
283283
cached.addPixmap(px);
@@ -870,7 +870,7 @@ bool Theme::isDarkColor(const QColor &color)
870870

871871
QColor Theme::getBackgroundAwareLinkColor(const QColor &backgroundColor)
872872
{
873-
return {(isDarkColor(backgroundColor) ? QColor("#6193dc") : QGuiApplication::palette().color(QPalette::Link))};
873+
return {(isDarkColor(backgroundColor) ? QColor(0x6193dc) : QGuiApplication::palette().color(QPalette::Link))};
874874
}
875875

876876
QColor Theme::getBackgroundAwareLinkColor()

0 commit comments

Comments
 (0)