mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
PaintBrush: Start fleshing out a toolbox widget.
This commit is contained in:
parent
d7756fc09f
commit
c4d24bb4e9
4 changed files with 64 additions and 7 deletions
36
Applications/PaintBrush/ToolboxWidget.cpp
Normal file
36
Applications/PaintBrush/ToolboxWidget.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
#include "ToolboxWidget.h"
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GButton.h>
|
||||
|
||||
ToolboxWidget::ToolboxWidget(GWidget* parent)
|
||||
: GFrame(parent)
|
||||
{
|
||||
set_background_color(Color::LightGray);
|
||||
set_fill_with_background_color(true);
|
||||
|
||||
set_frame_thickness(1);
|
||||
set_frame_shape(FrameShape::Panel);
|
||||
set_frame_shadow(FrameShadow::Raised);
|
||||
|
||||
set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
|
||||
set_preferred_size({ 48, 0 });
|
||||
|
||||
set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
layout()->set_margins({ 4, 4, 4, 4 });
|
||||
|
||||
auto add_tool = [&] (const StringView& name) {
|
||||
auto* button = new GButton(name, this);
|
||||
button->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||
button->set_preferred_size({ 0, 32 });
|
||||
button->set_checkable(true);
|
||||
button->set_exclusive(true);
|
||||
};
|
||||
|
||||
add_tool("Pen");
|
||||
add_tool("Buck");
|
||||
add_tool("Pick");
|
||||
}
|
||||
|
||||
ToolboxWidget::~ToolboxWidget()
|
||||
{
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue