mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:28:10 +00:00
HackStudio: Allow moving widgets around using the CursorTool
You can now move the widgets around, either by themselves or in group selections, by dragging them with the cursor tool. :^)
This commit is contained in:
parent
f6576c4b7c
commit
567769eb2f
4 changed files with 79 additions and 8 deletions
|
@ -1,6 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "Tool.h"
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibDraw/Point.h>
|
||||
|
||||
class GWidget;
|
||||
|
||||
class CursorTool final : public Tool {
|
||||
public:
|
||||
|
@ -15,4 +19,8 @@ private:
|
|||
virtual void on_mousedown(GMouseEvent&) override;
|
||||
virtual void on_mouseup(GMouseEvent&) override;
|
||||
virtual void on_mousemove(GMouseEvent&) override;
|
||||
|
||||
Point m_drag_origin;
|
||||
HashMap<GWidget*, Point> m_positions_before_drag;
|
||||
bool m_dragging { false };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue