1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:07:46 +00:00

LibGUI: Extend mimic pressed across keyboard shortcuts for buttons

Primary motivation for this was to get a visual indication in the
browser for Ctrl-R refresh. This extends what ForLoveOfCats had done
for calculator button shortcuts across all buttons with shortcuts.

When an action is triggered without an activator each associated button
will be set as mimic pressed.
This commit is contained in:
Rob Ryan 2022-04-03 15:50:32 +10:00 committed by Andreas Kling
parent 7af87e8e6b
commit 554709fec6
3 changed files with 25 additions and 2 deletions

View file

@ -131,6 +131,12 @@ void Action::activate(Core::Object* activator)
}
}
if (activator == nullptr) {
for_each_toolbar_button([](auto& button) {
button.set_mimic_pressed(true);
});
}
on_activation(*this);
m_activator = nullptr;
}