diff options
-rw-r--r-- | Applications/TextEditor/TextEditorWidget.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibGUI/GButton.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GToolBar.cpp | 3 |
3 files changed, 2 insertions, 9 deletions
diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp index 5d8a1f11a8..fefc9e5dcd 100644 --- a/Applications/TextEditor/TextEditorWidget.cpp +++ b/Applications/TextEditor/TextEditorWidget.cpp @@ -74,17 +74,11 @@ TextEditorWidget::TextEditorWidget() m_find_previous_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); m_find_previous_button->set_preferred_size(64, 0); m_find_previous_button->set_action(*m_find_previous_action); - m_find_previous_button->on_click = [&](auto&) { - m_find_previous_action->activate(); - }; m_find_next_button = new GButton("Next", m_find_widget); m_find_next_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); m_find_next_button->set_preferred_size(64, 0); m_find_next_button->set_action(*m_find_next_action); - m_find_next_button->on_click = [&](auto&) { - m_find_next_action->activate(); - }; m_find_textbox->on_return_pressed = [this] { m_find_next_button->click(); diff --git a/Libraries/LibGUI/GButton.cpp b/Libraries/LibGUI/GButton.cpp index fa03d1ff85..5ee0515d29 100644 --- a/Libraries/LibGUI/GButton.cpp +++ b/Libraries/LibGUI/GButton.cpp @@ -68,6 +68,8 @@ void GButton::click() } if (on_click) on_click(*this); + if (m_action) + m_action->activate(); } bool GButton::supports_keyboard_activation() const diff --git a/Libraries/LibGUI/GToolBar.cpp b/Libraries/LibGUI/GToolBar.cpp index de1eedbf89..93bb8b2f0c 100644 --- a/Libraries/LibGUI/GToolBar.cpp +++ b/Libraries/LibGUI/GToolBar.cpp @@ -31,9 +31,6 @@ void GToolBar::add_action(GAction& action) button->set_icon(item->action->icon()); else button->set_text(item->action->text()); - button->on_click = [&action](const GButton&) { - action.activate(); - }; button->set_button_style(ButtonStyle::CoolBar); button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); |