1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

PaintBrush: Allow canceling a line by pressing the Escape key

Sometimes you change your mind mid-line, and just want to get out of
the situation. You can now do that :^)
This commit is contained in:
Andreas Kling 2019-11-29 22:39:23 +01:00
parent 4e6cd541c9
commit b09ac26311
6 changed files with 21 additions and 1 deletions

View file

@ -96,6 +96,13 @@ void PaintableWidget::second_paint_event(GPaintEvent& event)
GWidget::second_paint_event(event);
}
void PaintableWidget::keydown_event(GKeyEvent& event)
{
if (m_tool)
m_tool->on_keydown(event);
GWidget::keydown_event(event);
}
void PaintableWidget::set_primary_color(Color color)
{
if (m_primary_color == color)