mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-21 20:45:51 +03:00
Make new connection wizard themable
This commit is contained in:
parent
c923e0803e
commit
0f03b47a46
6 changed files with 71 additions and 15 deletions
|
@ -148,5 +148,15 @@ QIcon ownCloudTheme::applicationIcon( ) const
|
|||
return themeIcon( QLatin1String("owncloud") );
|
||||
}
|
||||
|
||||
QColor ownCloudTheme::wizardHeaderBackgroundColor() const
|
||||
{
|
||||
return QColor("#1d2d42");
|
||||
}
|
||||
|
||||
QColor ownCloudTheme::wizardHeaderTitleColor() const
|
||||
{
|
||||
return QColor("#ffffff");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,9 @@ public:
|
|||
QIcon folderDisabledIcon() const;
|
||||
QIcon applicationIcon() const;
|
||||
|
||||
QColor wizardHeaderBackgroundColor() const;
|
||||
QColor wizardHeaderTitleColor() const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
|
|
@ -51,8 +51,11 @@ OwncloudSetupPage::OwncloudSetupPage()
|
|||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
// Backgroundcolor for owncloud logo #1d2d42
|
||||
setTitle(tr("Create Connection to %1").arg(Theme::instance()->appNameGUI()));
|
||||
Theme *theme = Theme::instance();
|
||||
setTitle( tr("<font color=\"%1\" size=\"5\">Connect to your %2 Server</font>")
|
||||
.arg(theme->wizardHeaderTitleColor().name()).arg( theme->appNameGUI()));
|
||||
setSubTitle( tr("<font color=\"%1\">Enter user credentials to access your %2</font>")
|
||||
.arg(theme->wizardHeaderTitleColor().name()).arg(theme->appNameGUI()));
|
||||
|
||||
connect(_ui.leUrl, SIGNAL(textChanged(QString)), SLOT(handleNewOcUrl(QString)));
|
||||
|
||||
|
@ -78,8 +81,6 @@ OwncloudSetupPage::OwncloudSetupPage()
|
|||
_ui.errorLabel->setStyleSheet( style );
|
||||
_ui.errorLabel->setWordWrap(true);
|
||||
_ui.errorLabel->setVisible(false);
|
||||
setTitle( tr("<font color=\"#ffffff\" size=\"5\">Connect to your %1 Server</font>").arg( Theme::instance()->appNameGUI()));
|
||||
setSubTitle( tr("<font color=\"#1d2d42\">Enter user credentials to access your %1</font>").arg(Theme::instance()->appNameGUI()));
|
||||
|
||||
// ButtonGroup for
|
||||
_selectiveSyncButtons = new QButtonGroup;
|
||||
|
@ -310,21 +311,24 @@ OwncloudWizardResultPage::OwncloudWizardResultPage()
|
|||
_ui.setupUi(this);
|
||||
// no fields to register.
|
||||
|
||||
Theme *theme = Theme::instance();
|
||||
setTitle( tr("<font color=\"%1\" size=\"5\">Everything set up!</font>")
|
||||
.arg(theme->wizardHeaderTitleColor().name()));
|
||||
setSubTitle( tr("<font color=\"%1\">Enter user credentials to access your %2</font>")
|
||||
.arg(theme->wizardHeaderTitleColor().name()).arg(theme->appNameGUI()));
|
||||
|
||||
_ui.pbOpenLocal->setText("Open local folder");
|
||||
|
||||
_ui.pbOpenServer->setText(tr("Open %1").arg(Theme::instance()->appNameGUI()));
|
||||
|
||||
setTitle( tr("<font color=\"#ffffff\" size=\"5\">Everything set up!</font>").arg( Theme::instance()->appNameGUI()));
|
||||
setSubTitle( tr("<font color=\"#1d2d42\">Enter user credentials to access your %1</font>").arg(Theme::instance()->appNameGUI()));
|
||||
|
||||
_ui.pbOpenLocal->setIcon(QIcon(":/mirall/resources/folder-sync.png"));
|
||||
_ui.pbOpenLocal->setText(tr("Open Local Folder"));
|
||||
_ui.pbOpenLocal->setIconSize(QSize(48, 48));
|
||||
|
||||
_ui.pbOpenLocal->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||
|
||||
_ui.pbOpenServer->setIcon(QIcon(":/mirall/resources/owncloud_logo_blue.png"));
|
||||
_ui.pbOpenServer->setText(tr("Open Server"));
|
||||
// _ui.pbOpenServer->setIcon(QIcon(":/mirall/resources/owncloud_logo_blue.png"));
|
||||
_ui.pbOpenServer->setIcon(theme->applicationIcon().pixmap(48));
|
||||
_ui.pbOpenServer->setText(tr("Open %1").arg(theme->appNameGUI()));
|
||||
_ui.pbOpenServer->setIconSize(QSize(48, 48));
|
||||
_ui.pbOpenServer->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||
setupCustomization();
|
||||
|
@ -394,13 +398,11 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
|
|||
|
||||
connect( _setupPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString)));
|
||||
|
||||
QPixmap pix(QSize(600, 78));
|
||||
pix.fill(QColor("#1d2d42"));
|
||||
setPixmap( QWizard::BannerPixmap, pix );
|
||||
|
||||
QPixmap logo( ":/mirall/resources/owncloud_logo.png");
|
||||
setPixmap( QWizard::LogoPixmap, logo );
|
||||
Theme *theme = Theme::instance();
|
||||
setWizardStyle(QWizard::ModernStyle);
|
||||
setPixmap( QWizard::BannerPixmap, theme->wizardHeaderBanner() );
|
||||
setPixmap( QWizard::LogoPixmap, theme->wizardHeaderLogo() );
|
||||
setOption( QWizard::NoBackButtonOnStartPage );
|
||||
setOption( QWizard::NoBackButtonOnLastPage );
|
||||
setOption( QWizard::NoCancelButton );
|
||||
|
|
|
@ -198,5 +198,27 @@ QVariant Theme::customMedia( CustomMediaType type )
|
|||
return re;
|
||||
}
|
||||
|
||||
QColor Theme::wizardHeaderTitleColor() const
|
||||
{
|
||||
return QColor();
|
||||
}
|
||||
|
||||
QColor Theme::wizardHeaderBackgroundColor() const
|
||||
{
|
||||
return QColor();
|
||||
}
|
||||
|
||||
QPixmap Theme::wizardHeaderLogo() const
|
||||
{
|
||||
return QPixmap(":/mirall/theme/colored/wizard_logo.png");
|
||||
}
|
||||
|
||||
QPixmap Theme::wizardHeaderBanner() const
|
||||
{
|
||||
QPixmap pix(QSize(600, 78));
|
||||
pix.fill(wizardHeaderBackgroundColor());
|
||||
return pix;
|
||||
}
|
||||
|
||||
} // end namespace mirall
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ class QIcon;
|
|||
class QString;
|
||||
class QObject;
|
||||
class QPixmap;
|
||||
class QColor;
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
|
@ -127,6 +128,24 @@ public:
|
|||
*/
|
||||
virtual QVariant customMedia( CustomMediaType type );
|
||||
|
||||
/** @return color for the setup wizard */
|
||||
virtual QColor wizardHeaderTitleColor() const;
|
||||
|
||||
/** @return color for the setup wizard. */
|
||||
virtual QColor wizardHeaderBackgroundColor() const;
|
||||
|
||||
/** @return logo for the setup wizard. */
|
||||
virtual QPixmap wizardHeaderLogo() const;
|
||||
|
||||
/**
|
||||
* The default implementation creates a
|
||||
* background based on
|
||||
* \ref wizardHeaderTitleColor().
|
||||
*
|
||||
* @return banner for the setup wizard.
|
||||
*/
|
||||
virtual QPixmap wizardHeaderBanner() const;
|
||||
|
||||
/**
|
||||
* About dialog contents
|
||||
*/
|
||||
|
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
Loading…
Reference in a new issue