Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slideshow buttons #1149

Merged
merged 19 commits into from
Sep 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9b476a5
Add files via upload
IzabelaBakollari Mar 18, 2019
ff7b0aa
Modified slideshow buttons and edited "Host your own server" link
IzabelaBakollari Mar 18, 2019
4902751
Merge branch 'master' into bugfixing-slideshow
DominiqueFuchs Sep 11, 2019
04fedf8
Added newly created next/prev svg's and fixed reduntant layout parts …
DominiqueFuchs Sep 12, 2019
907f36b
Merge branch 'bugfixing-slideshow' of https://github.com/nextcloud/de…
DominiqueFuchs Sep 12, 2019
9b60573
Merge branch 'master' into bugfixing-slideshow
DominiqueFuchs Sep 12, 2019
c873da7
Fixed wrong resource paths
DominiqueFuchs Sep 12, 2019
d420242
Merge branch 'bugfixing-slideshow' of https://github.com/nextcloud/de…
DominiqueFuchs Sep 12, 2019
f49cd18
Restructured layout, as the initial change were too broken (after add…
DominiqueFuchs Sep 12, 2019
ff5bf86
fix naming for slide navigation, adapted everywhere to be consistent
DominiqueFuchs Sep 12, 2019
1d96b10
Layout optimizations and tab access for self-hosting link
DominiqueFuchs Sep 12, 2019
af05db8
[WIP] Resource file and include changes as well as new control icons …
DominiqueFuchs Sep 13, 2019
544229d
[WIP] themed button implementation
DominiqueFuchs Sep 13, 2019
ace3da8
(Maybe) finished implementation of themed wizard buttons and accessib…
DominiqueFuchs Sep 13, 2019
3659bca
Merge branch 'master' into bugfixing-slideshow
DominiqueFuchs Sep 13, 2019
e8c8fe4
Added slight svg transparency as requested in ref issue, fixed bg det…
DominiqueFuchs Sep 13, 2019
f6bac6c
Merge branch 'bugfixing-slideshow' of https://github.com/nextcloud/de…
DominiqueFuchs Sep 13, 2019
1eb61b7
Fixed unused var
DominiqueFuchs Sep 13, 2019
82a67a4
Merge branch 'master' into bugfixing-slideshow
Sep 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
341 changes: 199 additions & 142 deletions src/gui/wizard/owncloudsetupnocredspage.ui

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion src/gui/wizard/owncloudsetuppage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/wizard/slideshow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void SlideShow::nextSlide()
_reverse = false;
}

void SlideShow::previousSlide()
void SlideShow::prevSlide()
{
setCurrentSlide((_currentIndex > 0 ? _currentIndex : _labels.count()) - 1);
_reverse = true;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/wizard/slideshow.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public slots:
void startShow(int interval = 0);
void stopShow();
void nextSlide();
void previousSlide();
void prevSlide();
void reset();

signals:
Expand Down
8 changes: 8 additions & 0 deletions src/libsync/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 8 additions & 0 deletions src/libsync/theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,14 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject
* 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
Expand Down
6 changes: 5 additions & 1 deletion theme.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<file>theme/white/state-sync-64.png</file>
<file>theme/white/state-sync-128.png</file>
<file>theme/white/state-sync-256.png</file>
<file>theme/black/state-error-32.png</file>
<file>theme/black/state-error-32.png</file>
<file>theme/black/state-error-64.png</file>
<file>theme/black/state-error-128.png</file>
<file>theme/black/state-error-256.png</file>
Expand Down Expand Up @@ -79,6 +79,8 @@
<file>theme/colored/state-warning-64.png</file>
<file>theme/colored/state-warning-128.png</file>
<file>theme/colored/state-warning-256.png</file>
<file>theme/black/control-next.svg</file>
<file>theme/black/control-prev.svg</file>
<file>theme/black/state-error.svg</file>
<file>theme/black/state-error-16.png</file>
<file>theme/black/state-offline.svg</file>
Expand All @@ -99,6 +101,8 @@
<file>theme/black/state-warning-64.png</file>
<file>theme/black/state-warning-128.png</file>
<file>theme/black/state-warning-256.png</file>
<file>theme/white/control-next.svg</file>
<file>theme/white/control-prev.svg</file>
<file>theme/white/state-error.svg</file>
<file>theme/white/state-error-16.png</file>
<file>theme/white/state-offline.svg</file>
Expand Down
9 changes: 9 additions & 0 deletions theme/black/control-next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions theme/black/control-prev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions theme/white/control-next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions theme/white/control-prev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.