diff options
author | Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> | 2019-09-15 20:12:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-15 20:12:22 +0300 |
commit | a2a753a34b48ca860cc448396d5efbdef3f404ab (patch) | |
tree | c4ad8a5b7ed02e6aaaadd8c3022f3faeaee395e0 /src/gui/wizard | |
parent | 7d4406254a6ad5d98ad0664ea5d65ac5b1b69c75 (diff) | |
parent | d0e25c230abf215c9ab1216a630f4876a69fc8fe (diff) |
Merge branch 'master' into fix_urlscheme_warning
Diffstat (limited to 'src/gui/wizard')
-rw-r--r-- | src/gui/wizard/owncloudsetupnocredspage.ui | 341 | ||||
-rw-r--r-- | src/gui/wizard/owncloudsetuppage.cpp | 18 | ||||
-rw-r--r-- | src/gui/wizard/slideshow.cpp | 2 | ||||
-rw-r--r-- | src/gui/wizard/slideshow.h | 2 |
4 files changed, 218 insertions, 145 deletions
diff --git a/src/gui/wizard/owncloudsetupnocredspage.ui b/src/gui/wizard/owncloudsetupnocredspage.ui index 10a44e49b..2ed3ed116 100644 --- a/src/gui/wizard/owncloudsetupnocredspage.ui +++ b/src/gui/wizard/owncloudsetupnocredspage.ui @@ -25,67 +25,24 @@ <property name="styleSheet"> <string notr="true"/> </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="16" column="0"> - <widget class="QLabel" name="bottomLabel"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string notr="true">TextLabel</string> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <spacer name="verticalSpacer_5"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="textFormat"> - <enum>Qt::RichText</enum> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> </property> - </widget> - </item> - <item row="14" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="bottomMargin"> - <number>0</number> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> </property> - <item> - <spacer name="horizontalSpacer_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="installLink"> - <property name="text"> - <string><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></string> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + </spacer> </item> - <item row="3" column="0"> + <item> <widget class="QLabel" name="topLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> @@ -107,117 +64,66 @@ </property> </widget> </item> - <item row="11" column="0" rowspan="2"> - <layout class="QHBoxLayout" name="buttons" stretch="0,0,0,0"> - <property name="spacing"> - <number>6</number> - </property> - <property name="topMargin"> - <number>20</number> - </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9"> <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> + <widget class="QPushButton" name="prevButton"> + <property name="minimumSize"> <size> <width>40</width> - <height>20</height> + <height>0</height> </size> </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="createAccountButton"> - <property name="minimumSize"> + <property name="maximumSize"> <size> - <width>150</width> - <height>0</height> + <width>40</width> + <height>16777215</height> </size> </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> <property name="text"> - <string>Register with a provider</string> + <string/> </property> - <property name="default"> - <bool>false</bool> + <property name="flat"> + <bool>true</bool> </property> </widget> </item> <item> - <widget class="QPushButton" name="loginButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <widget class="OCC::SlideShow" name="slideShow" native="true"> + <property name="font"> + <font> + <pointsize>12</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="nextButton"> <property name="minimumSize"> <size> - <width>150</width> + <width>40</width> <height>0</height> </size> </property> - <property name="text"> - <string>Log in</string> - </property> - <property name="autoDefault"> - <bool>false</bool> + <property name="maximumSize"> + <size> + <width>40</width> + <height>16777215</height> + </size> </property> - <property name="default"> - <bool>true</bool> + <property name="text"> + <string/> </property> <property name="flat"> - <bool>false</bool> + <bool>true</bool> </property> </widget> </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> </layout> </item> - <item row="6" column="0"> - <spacer name="verticalSpacer_4"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0"> - <widget class="OCC::SlideShow" name="slideShow"> - <property name="font"> - <font> - <pointsize>12</pointsize> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - </widget> - </item> - <item row="4" column="0"> + <item> <widget class="QWidget" name="login" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> @@ -385,8 +291,8 @@ </layout> </widget> </item> - <item row="0" column="0"> - <spacer name="verticalSpacer_5"> + <item> + <spacer name="verticalSpacer_4"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -401,6 +307,157 @@ </property> </spacer> </item> + <item> + <layout class="QHBoxLayout" name="buttons" stretch="0,0,0,0"> + <property name="spacing"> + <number>6</number> + </property> + <property name="topMargin"> + <number>20</number> + </property> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="createAccountButton"> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="text"> + <string>Register with a provider</string> + </property> + <property name="default"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="loginButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Log in</string> + </property> + <property name="autoDefault"> + <bool>false</bool> + </property> + <property name="default"> + <bool>true</bool> + </property> + <property name="flat"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QWidget" name="widget" native="true"> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QLabel" name="installLink"> + <property name="text"> + <string><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></string> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="bottomLabel"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string notr="true">TextLabel</string> + </property> + <property name="textFormat"> + <enum>Qt::RichText</enum> + </property> + </widget> + </item> </layout> </widget> <customwidgets> diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp index 3a956b0d7..fb2499c86 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 721adaad3..01ea9eaca 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 6cb53bf06..65743ec1f 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: |