mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
PaintBrush: Make ImageEditor forward keydown and keyup events to tool
This commit is contained in:
parent
55d96715ff
commit
06405e83d7
Notes:
sideshowbarker
2024-07-19 06:40:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/06405e83d79
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…
Reference in a new issue