1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:27:45 +00:00

SpaceAnalyzer: Added context menu for nodes

Currently supports 3 actions: Open, Copy Path, and Delete.
This commit is contained in:
Sviatoslav Peleshko 2021-02-20 17:02:28 +02:00 committed by Andreas Kling
parent 8d6525fc50
commit ff018607a1
4 changed files with 99 additions and 1 deletions

View file

@ -50,6 +50,7 @@ class TreeMapWidget final : public GUI::Frame {
public:
virtual ~TreeMapWidget() override;
Function<void()> on_path_change;
Function<void(GUI::ContextMenuEvent&)> on_context_menu_request;
size_t path_size() const;
const TreeMapNode* path_node(size_t n) const;
size_t viewpoint() const;
@ -62,6 +63,7 @@ private:
virtual void mousedown_event(GUI::MouseEvent&) override;
virtual void doubleclick_event(GUI::MouseEvent&) override;
virtual void mousewheel_event(GUI::MouseEvent&) override;
virtual void context_menu_event(GUI::ContextMenuEvent&) override;
bool rect_can_contain_children(const Gfx::IntRect& rect) const;
bool rect_can_contain_label(const Gfx::IntRect& rect) const;