diff --git a/NEXTCLOUD.cmake b/NEXTCLOUD.cmake index f13ab9a9b..011c41d10 100644 --- a/NEXTCLOUD.cmake +++ b/NEXTCLOUD.cmake @@ -22,3 +22,9 @@ option( WITH_CRASHREPORTER "Build crashreporter" OFF ) #set( CRASHREPORTER_ICON ":/owncloud-icon.png" ) option( WITH_PROVIDERS "Build with providers list" ON ) + + +## Theming options +set( APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR "#0082c9" 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") +option( APPLICATION_WIZARD_USE_CUSTOM_LOGO "Use the logo from ':/client/theme/colored/wizard_logo.png' else the default application icon is used" ON ) diff --git a/config.h.in b/config.h.in index c6b804f71..1223b0cfc 100644 --- a/config.h.in +++ b/config.h.in @@ -19,6 +19,9 @@ #cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@" #cmakedefine APPLICATION_UPDATE_URL "@APPLICATION_UPDATE_URL@" #cmakedefine APPLICATION_ICON_NAME "@APPLICATION_ICON_NAME@" +#cmakedefine APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR "@APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR@" +#cmakedefine APPLICATION_WIZARD_HEADER_TITLE_COLOR "@APPLICATION_WIZARD_HEADER_TITLE_COLOR@" +#cmakedefine APPLICATION_WIZARD_USE_CUSTOM_LOGO "@APPLICATION_WIZARD_USE_CUSTOM_LOGO@" #cmakedefine ZLIB_FOUND @ZLIB_FOUND@ diff --git a/src/libsync/nextcloudtheme.cpp b/src/libsync/nextcloudtheme.cpp index 6b5a20ea2..cc3247e1a 100644 --- a/src/libsync/nextcloudtheme.cpp +++ b/src/libsync/nextcloudtheme.cpp @@ -40,22 +40,4 @@ QVariant NextcloudTheme::customMedia(CustomMediaType) } #endif -#ifndef TOKEN_AUTH_ONLY -QColor NextcloudTheme::wizardHeaderBackgroundColor() const -{ - return QColor("#0082c9"); -} - -QColor NextcloudTheme::wizardHeaderTitleColor() const -{ - return QColor("#ffffff"); -} - -QPixmap NextcloudTheme::wizardHeaderLogo() const -{ - return QPixmap(hidpiFileName(":/client/theme/colored/wizard_logo.png")); -} - -#endif - } diff --git a/src/libsync/nextcloudtheme.h b/src/libsync/nextcloudtheme.h index adf940bbc..9dc7e61b4 100644 --- a/src/libsync/nextcloudtheme.h +++ b/src/libsync/nextcloudtheme.h @@ -32,12 +32,8 @@ public: #ifndef TOKEN_AUTH_ONLY QVariant customMedia(CustomMediaType type) override; - QColor wizardHeaderBackgroundColor() const override; - QColor wizardHeaderTitleColor() const override; - QPixmap wizardHeaderLogo() const override; #endif -private: }; } #endif // NEXTCLOUD_THEME_H diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 4a2c2afda..c049f7d7f 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -427,17 +427,21 @@ QIcon Theme::folderOfflineIcon(bool sysTray, bool sysTrayMenuVisible) const QColor Theme::wizardHeaderTitleColor() const { - return qApp->palette().text().color(); + return QColor(APPLICATION_WIZARD_HEADER_TITLE_COLOR); } QColor Theme::wizardHeaderBackgroundColor() const { - return QColor(); + return QColor(APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR); } QPixmap Theme::wizardHeaderLogo() const { +#ifdef APPLICATION_WIZARD_USE_CUSTOM_LOGO + return QPixmap(hidpiFileName(":/client/theme/colored/wizard_logo.png")); +#else return applicationIcon().pixmap(64); +#endif } QPixmap Theme::wizardHeaderBanner() const