mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:36:09 +00:00
UI: Options: Fix "Theme" selected value
This commit is contained in:
parent
8a1b710ea0
commit
80929e6d4a
@ -142,9 +142,10 @@ void IfacePage::retranslateComboTheme()
|
|||||||
// Sync with Qt::ColorScheme
|
// Sync with Qt::ColorScheme
|
||||||
const QStringList list = { tr("System"), tr("Light"), tr("Dark") };
|
const QStringList list = { tr("System"), tr("Light"), tr("Dark") };
|
||||||
|
|
||||||
const int currentIndex = qMax(m_comboTheme->currentIndex(), 0);
|
ControlUtil::setComboBoxTexts(m_comboTheme, list);
|
||||||
|
|
||||||
ControlUtil::setComboBoxTexts(m_comboTheme, list, currentIndex);
|
const auto colorScheme = IniUser::colorSchemeByName(iniUser()->theme());
|
||||||
|
m_comboTheme->setCurrentIndex(colorScheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IfacePage::retranslateComboHotKey()
|
void IfacePage::retranslateComboHotKey()
|
||||||
@ -336,9 +337,6 @@ QLayout *IfacePage::setupThemeLayout()
|
|||||||
});
|
});
|
||||||
m_comboTheme->setFixedWidth(200);
|
m_comboTheme->setFixedWidth(200);
|
||||||
|
|
||||||
const auto colorScheme = IniUser::colorSchemeByName(iniUser()->theme());
|
|
||||||
m_comboTheme->setCurrentIndex(colorScheme);
|
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
|
||||||
m_comboTheme->setEnabled(false);
|
m_comboTheme->setEnabled(false);
|
||||||
#endif
|
#endif
|
||||||
|
@ -74,6 +74,7 @@ private:
|
|||||||
QComboBox *m_comboLanguage = nullptr;
|
QComboBox *m_comboLanguage = nullptr;
|
||||||
QLabel *m_labelTheme = nullptr;
|
QLabel *m_labelTheme = nullptr;
|
||||||
QComboBox *m_comboTheme = nullptr;
|
QComboBox *m_comboTheme = nullptr;
|
||||||
|
|
||||||
QCheckBox *m_cbHotKeysEnabled = nullptr;
|
QCheckBox *m_cbHotKeysEnabled = nullptr;
|
||||||
QCheckBox *m_cbHotKeysGlobal = nullptr;
|
QCheckBox *m_cbHotKeysGlobal = nullptr;
|
||||||
QLabel *m_labelHotKey = nullptr;
|
QLabel *m_labelHotKey = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user