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

PixelPaint: Tool properties panel

Each tool can have its own set of properties that can be modified
through a panel on the right side.

The tools I've added properties for are:

Pen:
	Thickness

Brush:
	Size
	Hardness

Spray:
	Thickness
	Density

Bucket:
	Threshold
This commit is contained in:
BenJilks 2020-10-15 17:57:07 +00:00 committed by Andreas Kling
parent 544f2f3c96
commit afd52e2576
13 changed files with 324 additions and 12 deletions

View file

@ -33,6 +33,7 @@
#include "LayerPropertiesWidget.h"
#include "PaletteWidget.h"
#include "Tool.h"
#include "ToolPropertiesWidget.h"
#include "ToolboxWidget.h"
#include <LibGUI/AboutDialog.h>
#include <LibGUI/Action.h>
@ -84,10 +85,6 @@ int main(int argc, char** argv)
auto& image_editor = vertical_container.add<PixelPaint::ImageEditor>();
image_editor.set_focus(true);
toolbox.on_tool_selection = [&](auto* tool) {
image_editor.set_active_tool(tool);
};
vertical_container.add<PixelPaint::PaletteWidget>(image_editor);
auto& right_panel = horizontal_container.add<GUI::Widget>();
@ -100,6 +97,13 @@ int main(int argc, char** argv)
auto& layer_properties_widget = right_panel.add<PixelPaint::LayerPropertiesWidget>();
auto& tool_properties_widget = right_panel.add<PixelPaint::ToolPropertiesWidget>();
toolbox.on_tool_selection = [&](auto* tool) {
image_editor.set_active_tool(tool);
tool_properties_widget.set_active_tool(tool);
};
window->show();
auto menubar = GUI::MenuBar::construct();