diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index db9c59a46..38a20bc3c 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -77,10 +77,13 @@ ComboBox *SettingsLayout::addDropdown(const QString &text, ComboBox *SettingsLayout::addDropdown( const QString &text, const QStringList &items, - pajlada::Settings::Setting &setting) + pajlada::Settings::Setting &setting, bool editable) { auto combo = this->addDropdown(text, items); + if (editable) + combo->setEditable(true); + // update when setting changes setting.connect( [combo](const QString &value, auto) { combo->setCurrentText(value); }, @@ -185,8 +188,8 @@ void GeneralPage::initLayout(SettingsLayout &layout) layout.addTitle("Messages"); layout.addCheckbox("Timestamps", s.showTimestamps); layout.addDropdown("Timestamp format", - {"hh:mm", "h:mm", "hh:mm a", "h:mm a"}, - s.timestampFormat); + {"h:mm", "hh:mm", "h:mm a", "hh:mm a"}, + s.timestampFormat, true); layout.addDropdown( "Collapse messages", {"Never", "Longer than 2 lines", "Longer than 3 lines", diff --git a/src/widgets/settingspages/GeneralPage.hpp b/src/widgets/settingspages/GeneralPage.hpp index 12f06a322..4fd496997 100644 --- a/src/widgets/settingspages/GeneralPage.hpp +++ b/src/widgets/settingspages/GeneralPage.hpp @@ -75,7 +75,8 @@ public: QCheckBox *addCheckbox(const QString &text, BoolSetting &setting); ComboBox *addDropdown(const QString &text, const QStringList &items); ComboBox *addDropdown(const QString &text, const QStringList &items, - pajlada::Settings::Setting &setting); + pajlada::Settings::Setting &setting, + bool editable = false); template ComboBox *addDropdown(