mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
VisualBuilder: Add icons for the layout menu actions
This commit is contained in:
parent
3d0dba94ec
commit
4f184114de
Notes:
sideshowbarker
2024-07-19 12:03:38 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4f184114de2
3 changed files with 3 additions and 2 deletions
BIN
Base/res/icons/16x16/layout-horizontally.png
Normal file
BIN
Base/res/icons/16x16/layout-horizontally.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 104 B |
BIN
Base/res/icons/16x16/layout-vertically.png
Normal file
BIN
Base/res/icons/16x16/layout-vertically.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 B |
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue