Make all ProgressIndicator's background-aware (Dark-/Light-Mode switching)

Signed-off-by: Michael Schuster <michael@schuster.ms>
This commit is contained in:
Michael Schuster 2019-12-19 20:28:26 +01:00 committed by Michael Schuster
parent e4a20b9e72
commit b5ed16088a
6 changed files with 18 additions and 0 deletions

View file

@ -643,6 +643,9 @@ ActivitySettings::~ActivitySettings()
void ActivitySettings::slotStyleChanged() void ActivitySettings::slotStyleChanged()
{ {
if(_progressIndicator)
_progressIndicator->setColor(QGuiApplication::palette().color(QPalette::Text));
// Notify the other widgets (Dark-/Light-Mode switching) // Notify the other widgets (Dark-/Light-Mode switching)
emit styleChanged(); emit styleChanged();
} }

View file

@ -573,6 +573,8 @@ void ShareLinkWidget::customizeStyle()
_ui->confirmNote->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg")); _ui->confirmNote->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg"));
_ui->confirmPassword->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg")); _ui->confirmPassword->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg"));
_ui->confirmExpirationDate->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg")); _ui->confirmExpirationDate->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg"));
_ui->progressIndicator->setColor(QGuiApplication::palette().color(QPalette::Text));
} }
} }

View file

@ -380,6 +380,12 @@ void ShareUserGroupWidget::slotStyleChanged()
void ShareUserGroupWidget::customizeStyle() void ShareUserGroupWidget::customizeStyle()
{ {
_ui->confirmShare->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg")); _ui->confirmShare->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg"));
_pi_sharee.setColor(QGuiApplication::palette().color(QPalette::Text));
foreach (auto pi, _parentScrollArea->findChildren<QProgressIndicator *>()) {
pi->setColor(QGuiApplication::palette().color(QPalette::Text));;
}
} }
ShareUserLine::ShareUserLine(QSharedPointer<Share> share, ShareUserLine::ShareUserLine(QSharedPointer<Share> share,

View file

@ -396,6 +396,8 @@ void OwncloudAdvancedSetupPage::slotStyleChanged()
void OwncloudAdvancedSetupPage::customizeStyle() void OwncloudAdvancedSetupPage::customizeStyle()
{ {
if(_progressIndi)
_progressIndi->setColor(QGuiApplication::palette().color(QPalette::Text));
} }
} // namespace OCC } // namespace OCC

View file

@ -201,6 +201,8 @@ void OwncloudHttpCredsPage::slotStyleChanged()
void OwncloudHttpCredsPage::customizeStyle() void OwncloudHttpCredsPage::customizeStyle()
{ {
if(_progressIndi)
_progressIndi->setColor(QGuiApplication::palette().color(QPalette::Text));
} }
} // namespace OCC } // namespace OCC

View file

@ -442,6 +442,9 @@ void OwncloudSetupPage::customizeStyle()
pal.setColor(QPalette::WindowText, theme->wizardHeaderBackgroundColor()); pal.setColor(QPalette::WindowText, theme->wizardHeaderBackgroundColor());
_ui.slideShow->setPalette(pal); _ui.slideShow->setPalette(pal);
#endif #endif
if(_progressIndi)
_progressIndi->setColor(QGuiApplication::palette().color(QPalette::Text));
} }
} // namespace OCC } // namespace OCC