VisualBuilder: Add icons for the layout menu actions

This commit is contained in:
Andreas Kling 2019-09-17 22:39:48 +02:00
parent 3d0dba94ec
commit 4f184114de
Notes: sideshowbarker 2024-07-19 12:03:38 +09:00
3 changed files with 3 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

View file

@ -6,6 +6,7 @@
#include <AK/JsonObject.h>
#include <AK/StringBuilder.h>
#include <LibCore/CFile.h>
#include <LibDraw/PNGLoader.h>
#include <LibGUI/GAction.h>
#include <LibGUI/GBoxLayout.h>
#include <LibGUI/GMenu.h>
@ -37,13 +38,13 @@ VBForm::VBForm(const String& name, GWidget* parent)
widget->gwidget()->move_to_back();
}));
m_context_menu->add_separator();
m_context_menu->add_action(GAction::create("Lay out horizontally", [this](auto&) {
m_context_menu->add_action(GAction::create("Lay out horizontally", load_png("/res/icons/16x16/layout-horizontally.png"), [this](auto&) {
if (auto* widget = single_selected_widget()) {
dbg() << "Giving " << *widget->gwidget() << " a horizontal box layout";
widget->gwidget()->set_layout(make<GBoxLayout>(Orientation::Horizontal));
}
}));
m_context_menu->add_action(GAction::create("Lay out vertically", [this](auto&) {
m_context_menu->add_action(GAction::create("Lay out vertically", load_png("/res/icons/16x16/layout-vertically.png"), [this](auto&) {
if (auto* widget = single_selected_widget()) {
dbg() << "Giving " << *widget->gwidget() << " a vertical box layout";
widget->gwidget()->set_layout(make<GBoxLayout>(Orientation::Vertical));