From cb6e63e579fa2ab27060d9b2239cf5d00124a8d1 Mon Sep 17 00:00:00 2001 From: Marcus Nilsson Date: Mon, 2 Aug 2021 20:06:40 +0200 Subject: [PATCH] PixelPaint: Remove context menu for PenTool Remove the context menu for PenTool and just use the tool properties widget. --- Userland/Applications/PixelPaint/PenTool.cpp | 21 -------------------- Userland/Applications/PixelPaint/PenTool.h | 3 --- 2 files changed, 24 deletions(-) diff --git a/Userland/Applications/PixelPaint/PenTool.cpp b/Userland/Applications/PixelPaint/PenTool.cpp index f99e651e46..6df320d5f8 100644 --- a/Userland/Applications/PixelPaint/PenTool.cpp +++ b/Userland/Applications/PixelPaint/PenTool.cpp @@ -63,27 +63,6 @@ void PenTool::on_mousemove(Layer& layer, GUI::MouseEvent& event, GUI::MouseEvent m_last_drawing_event_position = event.position(); } -void PenTool::on_tool_button_contextmenu(GUI::ContextMenuEvent& event) -{ - if (!m_context_menu) { - m_context_menu = GUI::Menu::construct(); - m_thickness_actions.set_exclusive(true); - auto insert_action = [&](int size, bool checked = false) { - auto action = GUI::Action::create_checkable(String::number(size), [this, size](auto&) { - m_thickness = size; - }); - action->set_checked(checked); - m_thickness_actions.add_action(*action); - m_context_menu->add_action(move(action)); - }; - insert_action(1, true); - insert_action(2); - insert_action(3); - insert_action(4); - } - m_context_menu->popup(event.screen_position()); -} - GUI::Widget* PenTool::get_properties_widget() { if (!m_properties_widget) { diff --git a/Userland/Applications/PixelPaint/PenTool.h b/Userland/Applications/PixelPaint/PenTool.h index 7cdfd58733..8d4b8bea8f 100644 --- a/Userland/Applications/PixelPaint/PenTool.h +++ b/Userland/Applications/PixelPaint/PenTool.h @@ -20,15 +20,12 @@ public: virtual void on_mousedown(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override; virtual void on_mousemove(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override; virtual void on_mouseup(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override; - virtual void on_tool_button_contextmenu(GUI::ContextMenuEvent&) override; virtual GUI::Widget* get_properties_widget() override; private: Gfx::IntPoint m_last_drawing_event_position { -1, -1 }; - RefPtr m_context_menu; RefPtr m_properties_widget; int m_thickness { 1 }; - GUI::ActionGroup m_thickness_actions; }; }