mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
PixelPaint: Add a new "Rectangle Select" tool :^)
This patch only adds the tool along with a toolbar icon for it. It doesn't do anything yet.
This commit is contained in:
parent
ab840423a8
commit
4bd905de0e
Notes:
sideshowbarker
2024-07-18 12:14:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4bd905de0ec
5 changed files with 62 additions and 0 deletions
BIN
Base/res/icons/pixelpaint/rectangle-select.png
Normal file
BIN
Base/res/icons/pixelpaint/rectangle-select.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 B |
|
@ -20,6 +20,7 @@ set(SOURCES
|
|||
PickerTool.cpp
|
||||
PixelPaintWindowGML.h
|
||||
RectangleTool.cpp
|
||||
RectangleSelectTool.cpp
|
||||
SprayTool.cpp
|
||||
ToolboxWidget.cpp
|
||||
ToolPropertiesWidget.cpp
|
||||
|
|
35
Userland/Applications/PixelPaint/RectangleSelectTool.cpp
Normal file
35
Userland/Applications/PixelPaint/RectangleSelectTool.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "RectangleSelectTool.h"
|
||||
|
||||
namespace PixelPaint {
|
||||
|
||||
RectangleSelectTool::RectangleSelectTool()
|
||||
{
|
||||
}
|
||||
|
||||
RectangleSelectTool::~RectangleSelectTool()
|
||||
{
|
||||
}
|
||||
|
||||
void RectangleSelectTool::on_mousedown(Layer&, GUI::MouseEvent&, GUI::MouseEvent&)
|
||||
{
|
||||
}
|
||||
|
||||
void RectangleSelectTool::on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent&)
|
||||
{
|
||||
}
|
||||
|
||||
void RectangleSelectTool::on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&)
|
||||
{
|
||||
}
|
||||
|
||||
void RectangleSelectTool::on_second_paint(Layer const&, GUI::PaintEvent&)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
24
Userland/Applications/PixelPaint/RectangleSelectTool.h
Normal file
24
Userland/Applications/PixelPaint/RectangleSelectTool.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Tool.h"
|
||||
|
||||
namespace PixelPaint {
|
||||
|
||||
class RectangleSelectTool final : public Tool {
|
||||
public:
|
||||
RectangleSelectTool();
|
||||
virtual ~RectangleSelectTool();
|
||||
|
||||
virtual void on_mousedown(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) override;
|
||||
virtual void on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) override;
|
||||
virtual void on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) override;
|
||||
virtual void on_second_paint(Layer const&, GUI::PaintEvent&) override;
|
||||
};
|
||||
|
||||
}
|
|
@ -13,6 +13,7 @@
|
|||
#include "MoveTool.h"
|
||||
#include "PenTool.h"
|
||||
#include "PickerTool.h"
|
||||
#include "RectangleSelectTool.h"
|
||||
#include "RectangleTool.h"
|
||||
#include "SprayTool.h"
|
||||
#include "ZoomTool.h"
|
||||
|
@ -77,6 +78,7 @@ void ToolboxWidget::setup_tools()
|
|||
add_tool("Rectangle", "rectangle", { Mod_Ctrl | Mod_Shift, Key_R }, make<RectangleTool>());
|
||||
add_tool("Ellipse", "circle", { Mod_Ctrl | Mod_Shift, Key_E }, make<EllipseTool>());
|
||||
add_tool("Zoom", "zoom", { 0, Key_Z }, make<ZoomTool>());
|
||||
add_tool("Rectangle Select", "rectangle-select", { 0, Key_R }, make<RectangleSelectTool>());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue