From ab2bbaabc774656a3fb7a75da29a77919efa83e8 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 11 May 2022 17:40:23 +0100 Subject: KeyboardSettings: Set window modified state --- .../Applications/KeyboardSettings/KeyboardSettingsWidget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Userland') diff --git a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp index cb9736d2c8..6a66500d86 100644 --- a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp +++ b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp @@ -187,6 +187,7 @@ KeyboardSettingsWidget::KeyboardSettingsWidget() if (!selection.is_empty()) { auto& selected_keymap = keymaps_list_model.keymap_at(selection.first().row()); keymaps_list_model.set_active_keymap(selected_keymap); + set_modified(true); } }; @@ -202,8 +203,10 @@ KeyboardSettingsWidget::KeyboardSettingsWidget() m_add_keymap_button->on_click = [&](auto) { auto keymap = KeymapSelectionDialog::select_keymap(window(), keymaps_list_model.keymaps()); - if (!keymap.is_empty()) + if (!keymap.is_empty()) { keymaps_list_model.add_keymap(keymap); + set_modified(true); + } }; m_remove_keymap_button = find_descendant_of_type_named("remove_keymap_button"); @@ -218,6 +221,7 @@ KeyboardSettingsWidget::KeyboardSettingsWidget() } if (active_keymap_deleted) keymaps_list_model.set_active_keymap(keymaps_list_model.keymap_at(0)); + set_modified(true); }; m_selected_keymaps_listview->on_selection_change = [&]() { @@ -243,6 +247,9 @@ KeyboardSettingsWidget::KeyboardSettingsWidget() m_num_lock_checkbox = find_descendant_of_type_named("num_lock_checkbox"); m_num_lock_checkbox->set_checked(Config::read_bool("KeyboardSettings", "StartupEnable", "NumLock", true)); + m_num_lock_checkbox->on_checked = [&](auto) { + set_modified(true); + }; } KeyboardSettingsWidget::~KeyboardSettingsWidget() -- cgit v1.2.3