summaryrefslogtreecommitdiff
path: root/Userland/Applications/ClockSettings
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-04-21 12:01:51 +0100
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-04-23 10:48:51 -0700
commitae469b9afafc61d09ab79bda92c011d6266bdf92 (patch)
tree8aeccbf884969b8b05fd25620916f53a3c0146e4 /Userland/Applications/ClockSettings
parentc80fca78b3d53173a69ddb6d6233e014677c1474 (diff)
downloadserenity-ae469b9afafc61d09ab79bda92c011d6266bdf92.zip
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.
Diffstat (limited to 'Userland/Applications/ClockSettings')
-rw-r--r--Userland/Applications/ClockSettings/ClockSettingsWidget.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp b/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp
index 047520302a..b0b081cbfb 100644
--- a/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp
+++ b/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp
@@ -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);
};