ClockSettings: Don't change format text when checking "Custom"

Previously, when you selected to have a custom format, whatever was in
the custom-format box would get replaced with the format for
12-hour-without-seconds. Now, it keeps whatever was in the box before -
which is less disorientating, and lets you tweak the existing format.
This commit is contained in:
Sam Atkins 2022-04-21 12:01:51 +01:00 committed by Brian Gianforcaro
parent c80fca78b3
commit ae469b9afa
Notes: sideshowbarker 2024-07-17 11:34:15 +09:00

View file

@ -48,13 +48,17 @@ ClockSettingsWidget::ClockSettingsWidget()
m_custom_format_input->set_enabled(true);
}
m_24_hour_radio->on_checked = [&](bool) {
m_24_hour_radio->on_checked = [&](bool checked) {
if (!checked)
return;
m_show_seconds_checkbox->set_enabled(true);
m_custom_format_input->set_enabled(false);
update_time_format_string();
};
twelve_hour_radio.on_checked = [&](bool) {
twelve_hour_radio.on_checked = [&](bool checked) {
if (!checked)
return;
m_show_seconds_checkbox->set_enabled(true);
m_custom_format_input->set_enabled(false);
update_time_format_string();
@ -64,7 +68,9 @@ ClockSettingsWidget::ClockSettingsWidget()
update_time_format_string();
};
custom_radio.on_checked = [&](bool) {
custom_radio.on_checked = [&](bool checked) {
if (!checked)
return;
m_show_seconds_checkbox->set_enabled(false);
m_custom_format_input->set_enabled(true);
};