mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
allowing editing the timestamp freely
This commit is contained in:
parent
246f999a40
commit
7b06405a1c
|
@ -77,10 +77,13 @@ ComboBox *SettingsLayout::addDropdown(const QString &text,
|
|||
|
||||
ComboBox *SettingsLayout::addDropdown(
|
||||
const QString &text, const QStringList &items,
|
||||
pajlada::Settings::Setting<QString> &setting)
|
||||
pajlada::Settings::Setting<QString> &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<int>(
|
||||
"Collapse messages",
|
||||
{"Never", "Longer than 2 lines", "Longer than 3 lines",
|
||||
|
|
|
@ -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<QString> &setting);
|
||||
pajlada::Settings::Setting<QString> &setting,
|
||||
bool editable = false);
|
||||
|
||||
template <typename T>
|
||||
ComboBox *addDropdown(
|
||||
|
|
Loading…
Reference in a new issue