From ae469b9afafc61d09ab79bda92c011d6266bdf92 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 21 Apr 2022 12:01:51 +0100 Subject: [PATCH] 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. --- .../ClockSettings/ClockSettingsWidget.cpp | 12 +++++++++--- 1 file 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); };