mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
KeyboardSettings: Also activate keymap via ListView's on_activation
This commit is contained in:
parent
0317882b61
commit
6ed2ded77c
Notes:
sideshowbarker
2024-07-18 04:38:32 +09:00
Author: https://github.com/romch007 🔰 Commit: https://github.com/SerenityOS/serenity/commit/6ed2ded77c Pull-request: https://github.com/SerenityOS/serenity/pull/13733
@ -181,7 +181,8 @@ KeyboardSettingsWidget::KeyboardSettingsWidget()
|
||||
keymaps_list_model.set_active_keymap(m_initial_active_keymap);
|
||||
|
||||
m_activate_keymap_button = find_descendant_of_type_named<GUI::Button>("activate_keymap_button");
|
||||
m_activate_keymap_button->on_click = [&](auto) {
|
||||
|
||||
m_activate_keymap_event = [&]() {
|
||||
auto& selection = m_selected_keymaps_listview->selection();
|
||||
if (!selection.is_empty()) {
|
||||
auto& selected_keymap = keymaps_list_model.keymap_at(selection.first().row());
|
||||
@ -189,6 +190,14 @@ KeyboardSettingsWidget::KeyboardSettingsWidget()
|
||||
}
|
||||
};
|
||||
|
||||
m_activate_keymap_button->on_click = [&](auto) {
|
||||
m_activate_keymap_event();
|
||||
};
|
||||
|
||||
m_selected_keymaps_listview->on_activation = [&](auto) {
|
||||
m_activate_keymap_event();
|
||||
};
|
||||
|
||||
m_add_keymap_button = find_descendant_of_type_named<GUI::Button>("add_keymap_button");
|
||||
|
||||
m_add_keymap_button->on_click = [&](auto) {
|
||||
|
@ -40,4 +40,6 @@ private:
|
||||
RefPtr<GUI::Button> m_remove_keymap_button;
|
||||
RefPtr<GUI::TextEditor> m_test_typing_area;
|
||||
RefPtr<GUI::Button> m_clear_test_typing_area_button;
|
||||
|
||||
Function<void()> m_activate_keymap_event;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user