1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

KeyboardMapper: Avoid using [&] captures for persistent lambdas

These are not bugfixes, just improving the hygiene.
This commit is contained in:
Andreas Kling 2020-09-13 21:17:21 +02:00
parent 825fcb8292
commit 174527b580

View file

@ -65,7 +65,7 @@ void KeyboardMapperWidget::create_frame()
tmp_button.set_text(keys[i].name);
tmp_button.set_enabled(keys[i].enabled);
tmp_button.on_click = [&]() {
tmp_button.on_click = [this, &tmp_button]() {
String value;
if (GUI::InputBox::show(value, window(), "New Character:", "Select Character") == GUI::InputBox::ExecOK) {
int i = m_keys.find_first_index(&tmp_button).value_or(0);
@ -121,17 +121,17 @@ void KeyboardMapperWidget::create_frame()
};
auto& radio_shift = m_map_group->add<GUI::RadioButton>("Shift");
radio_shift.set_name("shift_map");
radio_shift.on_checked = [&](bool) {
radio_shift.on_checked = [this](bool) {
set_current_map("shift_map");
};
auto& radio_altgr = m_map_group->add<GUI::RadioButton>("AltGr");
radio_altgr.set_name("altgr_map");
radio_altgr.on_checked = [&](bool) {
radio_altgr.on_checked = [this](bool) {
set_current_map("altgr_map");
};
auto& radio_alt = m_map_group->add<GUI::RadioButton>("Alt");
radio_alt.set_name("alt_map");
radio_alt.on_checked = [&](bool) {
radio_alt.on_checked = [this](bool) {
set_current_map("alt_map");
};