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

PaintBrush: Add move tool context menu with "move to back/front"

Tools can now have an in-image context menu which you get when right-
clicking inside the image editing area. Our first use of this is to
provide the ability to move layers to the back/front. :^)
This commit is contained in:
Andreas Kling 2020-05-13 22:03:29 +02:00
parent 02d9cf2039
commit 720ebee1be
7 changed files with 62 additions and 0 deletions

View file

@ -117,6 +117,13 @@ void ImageEditor::mouseup_event(GUI::MouseEvent& event)
m_active_tool->on_mouseup(*m_active_layer, layer_event, event);
}
void ImageEditor::context_menu_event(GUI::ContextMenuEvent& event)
{
if (!m_active_layer || !m_active_tool)
return;
m_active_tool->on_context_menu(*m_active_layer, event);
}
void ImageEditor::keydown_event(GUI::KeyEvent& event)
{
if (m_active_tool)