Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schuster <michael@schuster.ms>2019-12-09 22:47:42 +0300
committerMichael Schuster <48932272+misch7@users.noreply.github.com>2019-12-09 23:37:21 +0300
commit789a2a7ae39f04fc1ad7b16ee28e5744a7dcec40 (patch)
treee2a6ede2dfa81dc31f0fc9794707e8029ed424bf /src/gui/generalsettings.cpp
parentbe4fc6b8874a6030d1fa456f63fd387504abecc7 (diff)
Make SettingsDialog background-aware (Dark-/Light-Mode switching)
Use customizeStyle() to change link colours in the SettingsDialog and notify it's widgets via slots. Also modify the background colour of the errors messages in AccountSettings::showConnectionLabel to always use an appropiate colour for it's custom-defined background. Signed-off-by: Michael Schuster <michael@schuster.ms>
Diffstat (limited to 'src/gui/generalsettings.cpp')
-rw-r--r--src/gui/generalsettings.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp
index 62381d36d..c2d5873af 100644
--- a/src/gui/generalsettings.cpp
+++ b/src/gui/generalsettings.cpp
@@ -70,7 +70,8 @@ GeneralSettings::GeneralSettings(QWidget *parent)
connect(_ui->legalNoticeButton, &QPushButton::clicked, this, &GeneralSettings::slotShowLegalNotice);
loadMiscSettings();
- slotUpdateInfo();
+ // updater info now set in: customizeStyle
+ //slotUpdateInfo();
// misc
connect(_ui->monoIconsCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
@@ -109,6 +110,8 @@ GeneralSettings::GeneralSettings(QWidget *parent)
// accountAdded means the wizard was finished and the wizard might change some options.
connect(AccountManager::instance(), &AccountManager::accountAdded, this, &GeneralSettings::loadMiscSettings);
+
+ customizeStyle();
}
GeneralSettings::~GeneralSettings()
@@ -149,7 +152,11 @@ void GeneralSettings::slotUpdateInfo()
connect(updater, &OCUpdater::downloadStateChanged, this, &GeneralSettings::slotUpdateInfo, Qt::UniqueConnection);
connect(_ui->restartButton, &QAbstractButton::clicked, updater, &OCUpdater::slotStartInstaller, Qt::UniqueConnection);
connect(_ui->restartButton, &QAbstractButton::clicked, qApp, &QApplication::quit, Qt::UniqueConnection);
- _ui->updateStateLabel->setText(updater->statusString());
+
+ QString status = updater->statusString();
+ Theme::replaceLinkColorStringBackgroundAware(status);
+ _ui->updateStateLabel->setText(status);
+
_ui->restartButton->setVisible(updater->downloadState() == OCUpdater::DownloadComplete);
} else {
// can't have those infos from sparkle currently
@@ -211,4 +218,20 @@ void GeneralSettings::slotShowLegalNotice()
delete notice;
}
+void GeneralSettings::slotStyleChanged()
+{
+ customizeStyle();
+}
+
+void GeneralSettings::customizeStyle()
+{
+ // setup about section
+ QString about = Theme::instance()->about();
+ Theme::replaceLinkColorStringBackgroundAware(about);
+ _ui->aboutLabel->setText(about);
+
+ // updater info
+ slotUpdateInfo();
+}
+
} // namespace OCC