connect(_flow2AuthWidget, &Flow2AuthWidget::urlCatched, this, &WebFlowCredentialsDialog::urlCatched);
+ // Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
+ connect(this, &WebFlowCredentialsDialog::styleChanged, _flow2AuthWidget, &Flow2AuthWidget::slotStyleChanged);
+
// allow Flow2 page to poll on window activation
connect(this, &WebFlowCredentialsDialog::onActivate, _flow2AuthWidget, &Flow2AuthWidget::slotPollNow);
} else {
WizardCommon::initErrorLabel(_errorLabel);
setLayout(_layout);
+
+ customizeStyle();
}
void WebFlowCredentialsDialog::closeEvent(QCloseEvent* e) {
void WebFlowCredentialsDialog::changeEvent(QEvent *e)
{
switch (e->type()) {
+ case QEvent::StyleChange:
+ case QEvent::PaletteChange:
+ case QEvent::ThemeChange:
+ customizeStyle();
+
+ // Notify the other widgets (Dark-/Light-Mode switching)
+ emit styleChanged();
+ break;
case QEvent::ActivationChange:
if(isActiveWindow())
emit onActivate();
QDialog::changeEvent(e);
}
+void WebFlowCredentialsDialog::customizeStyle()
+{
+ // HINT: Customize dialog's own style here, if necessary in the future (Dark-/Light-Mode switching)
+}
+
void WebFlowCredentialsDialog::slotShowSettingsDialog()
{
// bring window to top but slightly delay, to avoid being hidden behind the SettingsDialog
signals:
void urlCatched(const QString user, const QString pass, const QString host);
+ void styleChanged();
void onActivate();
private:
+ void customizeStyle();
+
bool _useFlow2;
Flow2AuthWidget *_flow2AuthWidget;
_ui.horizontalLayout->addWidget(_progressIndi);
stopSpinner(false);
+
+ customizeStyle();
}
void Flow2AuthCredsPage::initializePage()
_ui.copyLinkButton->setEnabled(true);
}
+void Flow2AuthCredsPage::slotStyleChanged()
+{
+ customizeStyle();
+}
+
+void Flow2AuthCredsPage::customizeStyle()
+{
+ if(_progressIndi)
+ _progressIndi->setColor(QGuiApplication::palette().color(QPalette::Text));
+}
+
} // namespace OCC
void asyncAuthResult(Flow2Auth::Result, const QString &user, const QString &appPassword);
void slotPollNow();
void slotStatusChanged(int secondsLeft);
+ void slotStyleChanged();
signals:
void connectToOCUrl(const QString &);
private:
void startSpinner();
void stopSpinner(bool showStatusLabel);
+ void customizeStyle();
QProgressIndicator *_progressIndi;
};
connect(_asyncAuth.data(), &Flow2Auth::statusChanged, this, &Flow2AuthWidget::slotStatusChanged);
connect(this, &Flow2AuthWidget::pollNow, _asyncAuth.data(), &Flow2Auth::slotPollNow);
_asyncAuth->start();
+
+ customizeStyle();
}
void Flow2AuthWidget::asyncAuthResult(Flow2Auth::Result r, const QString &user,
_ui.copyLinkButton->setEnabled(true);
}
+void Flow2AuthWidget::slotStyleChanged()
+{
+ customizeStyle();
+}
+
+void Flow2AuthWidget::customizeStyle()
+{
+ if(_progressIndi)
+ _progressIndi->setColor(QGuiApplication::palette().color(QPalette::Text));
+}
+
} // namespace OCC
void asyncAuthResult(Flow2Auth::Result, const QString &user, const QString &appPassword);
void slotPollNow();
void slotStatusChanged(int secondsLeft);
+ void slotStyleChanged();
signals:
void urlCatched(const QString user, const QString pass, const QString host);
private:
void startSpinner();
void stopSpinner(bool showStatusLabel);
+ void customizeStyle();
QProgressIndicator *_progressIndi;
};
// Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
connect(this, &OwncloudWizard::styleChanged, _setupPage, &OwncloudSetupPage::slotStyleChanged);
connect(this, &OwncloudWizard::styleChanged, _advancedSetupPage, &OwncloudAdvancedSetupPage::slotStyleChanged);
+ connect(this, &OwncloudWizard::styleChanged, _flow2CredsPage, &Flow2AuthCredsPage::slotStyleChanged);
customizeStyle();