Move wizard options to CMAKE as well
authorRoeland Jago Douma <roeland@famdouma.nl>
Thu, 31 Jan 2019 09:25:44 +0000 (10:25 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 31 Jan 2019 10:28:38 +0000 (11:28 +0100)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
NEXTCLOUD.cmake
config.h.in
src/libsync/nextcloudtheme.cpp
src/libsync/nextcloudtheme.h
src/libsync/theme.cpp

index f13ab9a9be32a7d4796379a975c1805182d0a984..011c41d10e2edc104635bfec6ea213677801a040 100644 (file)
@@ -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 )
index c6b804f71bf7d13d093bff8dae500189d2c6b5d8..1223b0cfc2438ad5a4b113f7cb22c1e9bc6370c2 100644 (file)
@@ -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@
 
index 6b5a20ea22118b62da742d8f8ba0e6acbc1af769..cc3247e1aabcfc3d563175754520728c86b50d03 100644 (file)
@@ -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
-
 }
index adf940bbc520b5223159f99f051b629bda9af246..9dc7e61b4496494fafae796d5048d9db8ed63d0e 100644 (file)
@@ -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
index 4a2c2afda26a97a02bd968c5faadfc55e40f962e..c049f7d7f6b319c0ef794bd0b28c32391caada84 100644 (file)
@@ -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