mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 15:58:47 +00:00
LibGUI: Remove Button& parameter from Button::on_click hook
There was but a single user of this parameter and it's a bit tedious to write it out every time, so let's get rid of it.
This commit is contained in:
parent
b1d35248e4
commit
a26b63a958
Notes:
sideshowbarker
2024-07-19 08:55:10 +09:00
Author: https://github.com/awesomekling
Commit: a26b63a958
26 changed files with 60 additions and 55 deletions
|
@ -55,7 +55,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](auto&) {
|
||||
button->on_click = [this] {
|
||||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue