UI: Options: Remove "Dark mode" flag (auto-follows system mode now)

This commit is contained in:
Nodir Temirkhodjaev 2022-12-10 20:31:01 +03:00
parent ea67eb42e7
commit 439643a26e
5 changed files with 10 additions and 16 deletions

View File

@ -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);

View File

@ -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;

View File

@ -6,6 +6,7 @@
#include <QMouseEvent>
#include <QStyle>
#include <QStyleFactory>
#include <QStyleHints>
#include <conf/confmanager.h>
#include <form/controls/mainwindow.h>
@ -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<UserSettings>()->iniUser().isDarkMode()
? QApplication::style()->standardPalette()
: QPalette());
QApplication::setPalette(QApplication::style()->standardPalette());
}
void WindowManager::setupMainWindow()

View File

@ -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); }

View File

@ -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");
}
}