mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 01:38:52 +00:00
LibGUI: Include keyboard modifier state with button on_click calls
This will allow you us to implement special behavior when Ctrl+clicking a button.
This commit is contained in:
parent
3a905aed06
commit
977863ea07
Notes:
sideshowbarker
2024-07-19 06:42:03 +09:00
Author: https://github.com/awesomekling
Commit: 977863ea07
37 changed files with 76 additions and 76 deletions
|
@ -60,7 +60,7 @@ RefPtr<LayoutNode> HTMLInputElement::create_layout_node(const StyleProperties*)
|
|||
auto& button = html_view.add<GUI::Button>(value());
|
||||
int text_width = Gfx::Font::default_font().width(value());
|
||||
button.set_relative_rect(0, 0, text_width + 20, 20);
|
||||
button.on_click = [this] {
|
||||
button.on_click = [this](auto) {
|
||||
if (auto* form = first_ancestor_of_type<HTMLFormElement>()) {
|
||||
// FIXME: Remove this const_cast once we have a non-const first_ancestor_of_type.
|
||||
const_cast<HTMLFormElement*>(form)->submit(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue