mirror of
https://github.com/RGBCube/serenity
synced 2025-07-08 22:47:34 +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
26 changed files with 60 additions and 55 deletions
|
@ -116,7 +116,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
label_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
label_button->set_tooltip("GLabel");
|
||||
label_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/label.png"));
|
||||
label_button->on_click = [](GUI::Button&) {
|
||||
label_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GLabel);
|
||||
};
|
||||
|
@ -125,7 +125,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
button_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
button_button->set_tooltip("GButton");
|
||||
button_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/button.png"));
|
||||
button_button->on_click = [](GUI::Button&) {
|
||||
button_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GButton);
|
||||
};
|
||||
|
@ -133,7 +133,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
spinbox_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
spinbox_button->set_tooltip("GSpinBox");
|
||||
spinbox_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/spinbox.png"));
|
||||
spinbox_button->on_click = [](GUI::Button&) {
|
||||
spinbox_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GSpinBox);
|
||||
};
|
||||
|
@ -141,7 +141,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
editor_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
editor_button->set_tooltip("GTextEditor");
|
||||
editor_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/textbox.png"));
|
||||
editor_button->on_click = [](GUI::Button&) {
|
||||
editor_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GTextEditor);
|
||||
};
|
||||
|
@ -149,7 +149,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
progress_bar_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
progress_bar_button->set_tooltip("GProgressBar");
|
||||
progress_bar_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/progressbar.png"));
|
||||
progress_bar_button->on_click = [](GUI::Button&) {
|
||||
progress_bar_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GProgressBar);
|
||||
};
|
||||
|
@ -157,7 +157,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
slider_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
slider_button->set_tooltip("GSlider");
|
||||
slider_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/slider.png"));
|
||||
slider_button->on_click = [](GUI::Button&) {
|
||||
slider_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GSlider);
|
||||
};
|
||||
|
@ -165,7 +165,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
checkbox_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
checkbox_button->set_tooltip("GCheckBox");
|
||||
checkbox_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/checkbox.png"));
|
||||
checkbox_button->on_click = [](GUI::Button&) {
|
||||
checkbox_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GCheckBox);
|
||||
};
|
||||
|
@ -173,7 +173,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
radiobutton_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
radiobutton_button->set_tooltip("GRadioButton");
|
||||
radiobutton_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/filled-radio-circle.png"));
|
||||
radiobutton_button->on_click = [](GUI::Button&) {
|
||||
radiobutton_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GRadioButton);
|
||||
};
|
||||
|
@ -181,7 +181,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
scrollbar_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
scrollbar_button->set_tooltip("GScrollBar");
|
||||
scrollbar_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/scrollbar.png"));
|
||||
scrollbar_button->on_click = [](GUI::Button&) {
|
||||
scrollbar_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GScrollBar);
|
||||
};
|
||||
|
@ -189,7 +189,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
|||
groupbox_button->set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
groupbox_button->set_tooltip("GGroupBox");
|
||||
groupbox_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/groupbox.png"));
|
||||
groupbox_button->on_click = [](GUI::Button&) {
|
||||
groupbox_button->on_click = [] {
|
||||
if (auto* form = VBForm::current())
|
||||
form->insert_widget(VBWidgetType::GGroupBox);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue