diff --git a/src/ui/form/opt/pages/optbasepage.h b/src/ui/form/opt/pages/optbasepage.h index 99944d74..c3a884fc 100644 --- a/src/ui/form/opt/pages/optbasepage.h +++ b/src/ui/form/opt/pages/optbasepage.h @@ -14,6 +14,7 @@ QT_FORWARD_DECLARE_CLASS(QMenu) QT_FORWARD_DECLARE_CLASS(QPushButton) QT_FORWARD_DECLARE_CLASS(QSplitter) QT_FORWARD_DECLARE_CLASS(QTabBar) +QT_FORWARD_DECLARE_CLASS(QToolButton) class ConfManager; class DriverManager; diff --git a/src/ui/form/opt/pages/optionspage.cpp b/src/ui/form/opt/pages/optionspage.cpp index e4731e53..12c1cfaf 100644 --- a/src/ui/form/opt/pages/optionspage.cpp +++ b/src/ui/form/opt/pages/optionspage.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -87,6 +88,13 @@ void OptionsPage::onAboutToSave() } } +void OptionsPage::onEditResetted() +{ + // Password + setPasswordEdited(false); + retranslateEditPassword(); +} + void OptionsPage::saveAutoRunMode(int mode) { if (m_currentAutoRunMode == mode) @@ -133,12 +141,6 @@ void OptionsPage::saveService(bool isService) fortManager(), &FortManager::processRestartRequired, Qt::QueuedConnection); } -void OptionsPage::onEditResetted() -{ - setPasswordEdited(false); - retranslateEditPassword(); -} - void OptionsPage::onRetranslateUi() { m_gbStartup->setTitle(tr("Startup")); @@ -477,7 +479,7 @@ void OptionsPage::setupEditPassword() void OptionsPage::setupPasswordLock() { - m_btPasswordLock = ControlUtil::createFlatButton(":/icons/lock_open.png", [&] { + m_btPasswordLock = ControlUtil::createToolButton(":/icons/lock_open.png", [&] { settings()->resetCheckedPassword(); m_btPasswordLock->hide(); }); diff --git a/src/ui/form/opt/pages/optionspage.h b/src/ui/form/opt/pages/optionspage.h index 4481f3ad..5b45d2dc 100644 --- a/src/ui/form/opt/pages/optionspage.h +++ b/src/ui/form/opt/pages/optionspage.h @@ -80,7 +80,7 @@ private: QCheckBox *m_cbHotKeys = nullptr; QCheckBox *m_cbPassword = nullptr; QLineEdit *m_editPassword = nullptr; - QPushButton *m_btPasswordLock = nullptr; + QToolButton *m_btPasswordLock = nullptr; QLabel *m_labelLanguage = nullptr; QComboBox *m_comboLanguage = nullptr; QLabel *m_labelTrayEvent = nullptr;