1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 15:05:07 +00:00

LibGUI+VisualBuilder: Add move-to-front/back to GCommonActions

Also give them nice little icons. :^)
This commit is contained in:
Andreas Kling 2019-09-14 22:42:02 +02:00
parent 92b17eab23
commit d754ac5bcb
5 changed files with 14 additions and 2 deletions

View file

@ -27,11 +27,11 @@ VBForm::VBForm(const String& name, GWidget* parent)
set_greedy_for_hits(true);
m_context_menu = make<GMenu>();
m_context_menu->add_action(GAction::create("Move to front", [this](auto&) {
m_context_menu->add_action(GCommonActions::make_move_to_front_action([this](auto&) {
if (auto* widget = single_selected_widget())
widget->gwidget()->move_to_front();
}));
m_context_menu->add_action(GAction::create("Move to back", [this](auto&) {
m_context_menu->add_action(GCommonActions::make_move_to_back_action([this](auto&) {
if (auto* widget = single_selected_widget())
widget->gwidget()->move_to_back();
}));