diff --git a/src/gui/wizard/owncloudsetupnocredspage.ui b/src/gui/wizard/owncloudsetupnocredspage.ui index 10a44e49b6..2ed3ed1163 100644 --- a/src/gui/wizard/owncloudsetupnocredspage.ui +++ b/src/gui/wizard/owncloudsetupnocredspage.ui @@ -25,67 +25,24 @@ - - - - + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + - 0 - 0 + 20 + 20 - - TextLabel - - - Qt::RichText - - + - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - <a href="https://docs.nextcloud.com/server/15/admin_manual/installation/index.html#installation"><span style=" text-decoration: underline; color:#0000ff;">Host your own server</span></a> - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - + @@ -107,117 +64,66 @@ - - - - 6 - - - 20 - + + - - - Qt::Horizontal - - + + 40 - 20 - - - - - - - - - 150 0 - - false - - - Register with a provider - - - false - - - - - - - - 0 - 0 - - - + - 150 - 0 + 40 + 16777215 - Log in - - - false - - - true + - false + true - - - Qt::Horizontal + + + + 12 + 75 + true + - + + + + + 40 - 20 + 0 - + + + 40 + 16777215 + + + + + + + true + + - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 20 - - - - - - - - - 12 - 75 - true - - - - - + @@ -385,8 +291,8 @@ - - + + Qt::Vertical @@ -401,6 +307,157 @@ + + + + 6 + + + 20 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 150 + 0 + + + + false + + + Register with a provider + + + false + + + + + + + + 0 + 0 + + + + + 150 + 0 + + + + Log in + + + false + + + true + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + <a href="https://docs.nextcloud.com/server/15/admin_manual/installation/index.html#installation"><span style=" text-decoration: underline; color:#7a7a7a;">Host your own server</span></a> + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + Qt::RichText + + + diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp index 3a956b0d70..fb2499c86b 100644 --- a/src/gui/wizard/owncloudsetuppage.cpp +++ b/src/gui/wizard/owncloudsetuppage.cpp @@ -84,7 +84,23 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent) _ui.slideShow->addSlide(Theme::hidpiFileName(":/client/theme/colored/wizard-files.png"), tr("Secure collaboration & file exchange")); _ui.slideShow->addSlide(Theme::hidpiFileName(":/client/theme/colored/wizard-groupware.png"), tr("Easy-to-use web mail, calendaring & contacts")); _ui.slideShow->addSlide(Theme::hidpiFileName(":/client/theme/colored/wizard-talk.png"), tr("Screensharing, online meetings & web conferences")); - connect(_ui.slideShow, &SlideShow::clicked, _ui.slideShow, &SlideShow::nextSlide); + + connect(_ui.slideShow, &SlideShow::clicked, _ui.slideShow, &SlideShow::stopShow); + connect(_ui.nextButton, &QPushButton::clicked, _ui.slideShow, &SlideShow::nextSlide); + connect(_ui.prevButton, &QPushButton::clicked, _ui.slideShow, &SlideShow::prevSlide); + + auto widgetBgLightness = OwncloudSetupPage::palette().color(OwncloudSetupPage::backgroundRole()).lightness(); + bool widgetHasDarkBg = + (widgetBgLightness >= 125) + ? false + : true; + _ui.nextButton->setIcon(theme->uiThemeIcon(QString("control-next.svg"), widgetHasDarkBg)); + _ui.prevButton->setIcon(theme->uiThemeIcon(QString("control-prev.svg"), widgetHasDarkBg)); + + // QPushButtons are a mess when it comes to consistent background coloring without stylesheets, + // so we do it here even though this is an exceptional styling method here + _ui.createAccountButton->setStyleSheet("QPushButton {background-color: #0082C9; color: white}"); + _ui.slideShow->startShow(); QPalette pal = _ui.slideShow->palette(); diff --git a/src/gui/wizard/slideshow.cpp b/src/gui/wizard/slideshow.cpp index 721adaad3d..01ea9eacad 100644 --- a/src/gui/wizard/slideshow.cpp +++ b/src/gui/wizard/slideshow.cpp @@ -116,7 +116,7 @@ void SlideShow::nextSlide() _reverse = false; } -void SlideShow::previousSlide() +void SlideShow::prevSlide() { setCurrentSlide((_currentIndex > 0 ? _currentIndex : _labels.count()) - 1); _reverse = true; diff --git a/src/gui/wizard/slideshow.h b/src/gui/wizard/slideshow.h index 6cb53bf062..65743ec1fa 100644 --- a/src/gui/wizard/slideshow.h +++ b/src/gui/wizard/slideshow.h @@ -51,7 +51,7 @@ public slots: void startShow(int interval = 0); void stopShow(); void nextSlide(); - void previousSlide(); + void prevSlide(); void reset(); signals: diff --git a/src/libsync/clientsideencryptionjobs.cpp b/src/libsync/clientsideencryptionjobs.cpp index f9db267931..5321f938ac 100644 --- a/src/libsync/clientsideencryptionjobs.cpp +++ b/src/libsync/clientsideencryptionjobs.cpp @@ -432,6 +432,7 @@ void SignPublicKeyApiJob::start() { QNetworkRequest req; req.setRawHeader("OCS-APIREQUEST", "true"); + req.setHeader(QNetworkRequest::ContentTypeHeader, QByteArrayLiteral("application/x-www-form-urlencoded")); QUrlQuery query; query.addQueryItem(QLatin1String("format"), QLatin1String("json")); QUrl url = Utility::concatUrlPath(account()->url(), path()); diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index ed29647295..093995513c 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -177,6 +177,14 @@ QIcon Theme::themeIcon(const QString &name, bool sysTray, bool sysTrayMenuVisibl return cached; } +QIcon Theme::uiThemeIcon(const QString &iconName, bool uiHasDarkBg) const +{ + QString themeResBasePath = ":/client/theme/"; + QString iconPath = themeResBasePath + (uiHasDarkBg?"white/":"black/") + iconName; + std::string icnPath = iconPath.toUtf8().constData(); + return QIcon(QPixmap(iconPath)); +} + QString Theme::hidpiFileName(const QString &fileName, QPaintDevice *dev) { qreal devicePixelRatio = dev ? dev->devicePixelRatio() : qApp->primaryScreen()->devicePixelRatio(); diff --git a/src/libsync/theme.h b/src/libsync/theme.h index f703fd8b57..bccb239d7d 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -347,6 +347,14 @@ public: * important dependency versions. */ virtual QString versionSwitchOutput() const; + + /** + * @brief Request suitable QIcon resource depending on the background colour of the parent widget. + * + * This should be replaced (TODO) by a real theming implementation for the client UI + * (actually 2019/09/13 only systray theming). + */ + virtual QIcon uiThemeIcon(const QString &iconName, bool uiHasDarkBg) const; protected: #ifndef TOKEN_AUTH_ONLY diff --git a/theme.qrc b/theme.qrc index 44d0dfc728..006056b87b 100644 --- a/theme.qrc +++ b/theme.qrc @@ -43,7 +43,7 @@ theme/white/state-sync-64.png theme/white/state-sync-128.png theme/white/state-sync-256.png - theme/black/state-error-32.png + theme/black/state-error-32.png theme/black/state-error-64.png theme/black/state-error-128.png theme/black/state-error-256.png @@ -79,6 +79,8 @@ theme/colored/state-warning-64.png theme/colored/state-warning-128.png theme/colored/state-warning-256.png + theme/black/control-next.svg + theme/black/control-prev.svg theme/black/state-error.svg theme/black/state-error-16.png theme/black/state-offline.svg @@ -99,6 +101,8 @@ theme/black/state-warning-64.png theme/black/state-warning-128.png theme/black/state-warning-256.png + theme/white/control-next.svg + theme/white/control-prev.svg theme/white/state-error.svg theme/white/state-error-16.png theme/white/state-offline.svg diff --git a/theme/black/control-next.svg b/theme/black/control-next.svg new file mode 100644 index 0000000000..19c7d0159b --- /dev/null +++ b/theme/black/control-next.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/theme/black/control-prev.svg b/theme/black/control-prev.svg new file mode 100644 index 0000000000..97fe7a90df --- /dev/null +++ b/theme/black/control-prev.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/theme/white/control-next.svg b/theme/white/control-next.svg new file mode 100644 index 0000000000..9194dbe6ee --- /dev/null +++ b/theme/white/control-next.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/theme/white/control-prev.svg b/theme/white/control-prev.svg new file mode 100644 index 0000000000..e3a3225947 --- /dev/null +++ b/theme/white/control-prev.svg @@ -0,0 +1,9 @@ + + + + + + + + +