mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 20:17:13 +02:00
PixelPaint: Move Tools to it's own subdirectory
The PixelPaint source directory was getting a bit large, let's move all the Tools to it's own subdirectory. Also remove some unused includes.
This commit is contained in:
committed by
Brian Gianforcaro
parent
61ad239ee0
commit
f9e0815c3b
Notes:
sideshowbarker
2024-07-18 03:37:42 +09:00
Author: https://github.com/metmo Commit: https://github.com/SerenityOS/serenity/commit/f9e0815c3b2 Pull-request: https://github.com/SerenityOS/serenity/pull/10083 Reviewed-by: https://github.com/TobyAsE ✅
43
Userland/Applications/PixelPaint/Tools/GuideTool.h
Normal file
43
Userland/Applications/PixelPaint/Tools/GuideTool.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../Guide.h"
|
||||
#include "Tool.h"
|
||||
#include <AK/RefPtr.h>
|
||||
|
||||
namespace PixelPaint {
|
||||
|
||||
class GuideTool final : public Tool {
|
||||
public:
|
||||
GuideTool();
|
||||
|
||||
virtual ~GuideTool() override;
|
||||
|
||||
virtual void on_mousedown(Layer*, MouseEvent&) override;
|
||||
virtual void on_mousemove(Layer*, MouseEvent&) override;
|
||||
virtual void on_mouseup(Layer*, MouseEvent&) override;
|
||||
virtual void on_context_menu(Layer*, GUI::ContextMenuEvent&) override;
|
||||
|
||||
virtual void on_tool_activation() override;
|
||||
|
||||
virtual GUI::Widget* get_properties_widget() override;
|
||||
virtual Gfx::StandardCursor cursor() override { return Gfx::StandardCursor::Crosshair; }
|
||||
|
||||
private:
|
||||
RefPtr<Guide> closest_guide(Gfx::IntPoint const&);
|
||||
|
||||
RefPtr<GUI::Widget> m_properties_widget;
|
||||
|
||||
RefPtr<Guide> m_selected_guide;
|
||||
RefPtr<Guide> m_context_menu_guide;
|
||||
Gfx::IntPoint m_event_origin;
|
||||
float m_guide_origin { 0 };
|
||||
RefPtr<GUI::Menu> m_context_menu;
|
||||
int m_snap_size { 10 };
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user