1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00

VisualBuilder: Add GCheckBox and GLabel, and draw icons for them, too.

This commit is contained in:
Andreas Kling 2019-04-11 06:32:27 +02:00
parent b5d1cfef58
commit f25c524f20
5 changed files with 38 additions and 6 deletions

View file

@ -66,6 +66,14 @@ GWindow* make_toolbox_window()
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
window->set_main_widget(widget);
auto* label_button = new GButton(widget);
label_button->set_tooltip("GLabel");
label_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/label.png"));
label_button->on_click = [] (GButton&) {
if (auto* form = VBForm::current())
form->insert_widget(WidgetType::GLabel);
};
auto* button_button = new GButton(widget);
button_button->set_tooltip("GButton");
button_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/button.png"));
@ -94,5 +102,12 @@ GWindow* make_toolbox_window()
if (auto* form = VBForm::current())
form->insert_widget(WidgetType::GProgressBar);
};
auto* checkbox_button = new GButton(widget);
checkbox_button->set_tooltip("GCheckBox");
checkbox_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/checkbox.png"));
checkbox_button->on_click = [] (GButton&) {
if (auto* form = VBForm::current())
form->insert_widget(WidgetType::GCheckBox);
};
return window;
}