mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
PaintBrush: Tools can receive KeyUp events
This commit is contained in:
parent
7301db4f9a
commit
b185c7f58a
Notes:
sideshowbarker
2024-07-19 10:49:44 +09:00
Author: https://github.com/zyperpl 🔰 Commit: https://github.com/SerenityOS/serenity/commit/b185c7f58a7 Pull-request: https://github.com/SerenityOS/serenity/pull/883 Reviewed-by: https://github.com/bugaevc
@ -103,6 +103,13 @@ void PaintableWidget::keydown_event(GKeyEvent& event)
|
||||
GWidget::keydown_event(event);
|
||||
}
|
||||
|
||||
void PaintableWidget::keyup_event(GKeyEvent& event)
|
||||
{
|
||||
if (m_tool)
|
||||
m_tool->on_keyup(event);
|
||||
GWidget::keyup_event(event);
|
||||
}
|
||||
|
||||
void PaintableWidget::set_primary_color(Color color)
|
||||
{
|
||||
if (m_primary_color == color)
|
||||
|
@ -39,6 +39,7 @@ private:
|
||||
virtual void mouseup_event(GMouseEvent&) override;
|
||||
virtual void mousemove_event(GMouseEvent&) override;
|
||||
virtual void keydown_event(GKeyEvent&) override;
|
||||
virtual void keyup_event(GKeyEvent&) override;
|
||||
|
||||
RefPtr<GraphicsBitmap> m_bitmap;
|
||||
|
||||
|
@ -14,6 +14,7 @@ public:
|
||||
virtual void on_contextmenu(GContextMenuEvent&) {}
|
||||
virtual void on_second_paint(GPaintEvent&) {}
|
||||
virtual void on_keydown(GKeyEvent&) {}
|
||||
virtual void on_keyup(GKeyEvent&) {}
|
||||
|
||||
void clear() { m_widget = nullptr; }
|
||||
void setup(PaintableWidget& widget) { m_widget = widget.make_weak_ptr(); }
|
||||
|
Loading…
Reference in New Issue
Block a user