diff --git a/src/ui/form/opt/pages/optionspage.cpp b/src/ui/form/opt/pages/optionspage.cpp index a3cfad46..39c2dfaa 100644 --- a/src/ui/form/opt/pages/optionspage.cpp +++ b/src/ui/form/opt/pages/optionspage.cpp @@ -175,7 +175,6 @@ void OptionsPage::onRetranslateUi() m_cbExplorerMenu->setText(tr("Windows Explorer integration")); m_cbHotKeys->setText(tr("Hot Keys")); - m_cbDarkMode->setText(tr("Dark Mode")); m_cbPassword->setText(tr("Password:")); retranslateEditPassword(); @@ -467,13 +466,6 @@ void OptionsPage::setupGlobalBox() confManager()->saveIniUser(true); }); - m_cbDarkMode = ControlUtil::createCheckBox(iniUser()->isDarkMode(), [&](bool checked) { - iniUser()->setIsDarkMode(checked); - confManager()->saveIniUser(true); - - windowManager()->setupAppPalette(); - }); - // Password Row auto passwordLayout = setupPasswordLayout(); setupPasswordLock(); @@ -484,7 +476,6 @@ void OptionsPage::setupGlobalBox() auto layout = new QVBoxLayout(); layout->addWidget(m_cbExplorerMenu); layout->addWidget(m_cbHotKeys); - layout->addWidget(m_cbDarkMode); layout->addLayout(passwordLayout); layout->addWidget(m_btPasswordLock, 0, Qt::AlignCenter); layout->addLayout(langLayout); diff --git a/src/ui/form/opt/pages/optionspage.h b/src/ui/form/opt/pages/optionspage.h index eaa3f12b..f60248b2 100644 --- a/src/ui/form/opt/pages/optionspage.h +++ b/src/ui/form/opt/pages/optionspage.h @@ -82,7 +82,6 @@ private: QComboBox *m_comboFilterMode = nullptr; QCheckBox *m_cbExplorerMenu = nullptr; QCheckBox *m_cbHotKeys = nullptr; - QCheckBox *m_cbDarkMode = nullptr; QCheckBox *m_cbPassword = nullptr; QLineEdit *m_editPassword = nullptr; QToolButton *m_btPasswordLock = nullptr; diff --git a/src/ui/manager/windowmanager.cpp b/src/ui/manager/windowmanager.cpp index 83f3de2f..6613e0fa 100644 --- a/src/ui/manager/windowmanager.cpp +++ b/src/ui/manager/windowmanager.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include
@@ -49,6 +50,9 @@ void WindowManager::setUp() setupMainWindow(); + connect(QApplication::styleHints(), &QStyleHints::appearanceChanged, this, + &WindowManager::setupAppPalette); + connect(qApp, &QCoreApplication::aboutToQuit, this, &WindowManager::closeAll); } @@ -82,9 +86,7 @@ QFont WindowManager::defaultFont() void WindowManager::setupAppPalette() { - QApplication::setPalette(IoC()->iniUser().isDarkMode() - ? QApplication::style()->standardPalette() - : QPalette()); + QApplication::setPalette(QApplication::style()->standardPalette()); } void WindowManager::setupMainWindow() diff --git a/src/ui/user/iniuser.h b/src/ui/user/iniuser.h index f11baef4..a514ea15 100644 --- a/src/ui/user/iniuser.h +++ b/src/ui/user/iniuser.h @@ -14,9 +14,6 @@ public: QString language() const { return valueText("base/language", defaultLanguage()); } void setLanguage(const QString &v) { setValue("base/language", v); } - bool isDarkMode() const { return valueBool("base/isDarkMode"); } - void setIsDarkMode(bool v) { setValue("base/isDarkMode", v); } - bool hotKeyEnabled() const { return valueBool("hotKey/enabled"); } void setHotKeyEnabled(bool v) { setValue("hotKey/enabled", v); } diff --git a/src/ui/user/usersettings.cpp b/src/ui/user/usersettings.cpp index 8dc1c442..dba47e24 100644 --- a/src/ui/user/usersettings.cpp +++ b/src/ui/user/usersettings.cpp @@ -78,4 +78,9 @@ void UserSettings::migrateIniOnWrite() ini()->setValue("statWindow/showHostNames", cacheValue("statWindow/showHostNames")); ini()->setValue("statWindow/maximized", cacheValue("statWindow/maximized")); } + + // COMPAT: v3.6.2: Remove "Dark Mode" + if (version < 0x030602) { + removeIniKey("base/isDarkMode"); + } }