mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:07:44 +00:00
PaintBrush: Make ImageEditor forward keydown and keyup events to tool
This commit is contained in:
parent
55d96715ff
commit
06405e83d7
2 changed files with 14 additions and 1 deletions
|
@ -98,6 +98,18 @@ void ImageEditor::mouseup_event(GUI::MouseEvent& event)
|
|||
m_active_tool->on_mouseup(*m_active_layer, layer_event, event);
|
||||
}
|
||||
|
||||
void ImageEditor::keydown_event(GUI::KeyEvent& event)
|
||||
{
|
||||
if (m_active_tool)
|
||||
m_active_tool->on_keydown(event);
|
||||
}
|
||||
|
||||
void ImageEditor::keyup_event(GUI::KeyEvent& event)
|
||||
{
|
||||
if (m_active_tool)
|
||||
m_active_tool->on_keydown(event);
|
||||
}
|
||||
|
||||
void ImageEditor::set_active_layer(Layer* layer)
|
||||
{
|
||||
if (m_active_layer == layer)
|
||||
|
@ -162,5 +174,4 @@ void ImageEditor::set_secondary_color(Color color)
|
|||
on_secondary_color_change(color);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -72,6 +72,8 @@ private:
|
|||
virtual void mousedown_event(GUI::MouseEvent&) override;
|
||||
virtual void mousemove_event(GUI::MouseEvent&) override;
|
||||
virtual void mouseup_event(GUI::MouseEvent&) override;
|
||||
virtual void keydown_event(GUI::KeyEvent&) override;
|
||||
virtual void keyup_event(GUI::KeyEvent&) override;
|
||||
|
||||
RefPtr<Image> m_image;
|
||||
RefPtr<Layer> m_active_layer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue