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

PixelPaint: Allow keydown events to bubble from ImageEditor

Previously, all keydown KeyEvents were accepted, causing parent widgets
not to receive them. With the addition of shortcut handling to keydown,
shortcuts were not called when the ImageEditor was focused.
This commit is contained in:
Zaggy1024 2022-10-24 20:17:21 -05:00 committed by Sam Atkins
parent 967dfa7956
commit 7ce346e50e
19 changed files with 62 additions and 41 deletions

View file

@ -150,9 +150,8 @@ void PolygonalSelectTool::on_second_paint(Layer const* layer, GUI::PaintEvent& e
painter.draw_line(last_line_start, last_line_stop, Color::Black, AK::max(m_editor->scale(), 1));
}
void PolygonalSelectTool::on_keydown(GUI::KeyEvent& key_event)
bool PolygonalSelectTool::on_keydown(GUI::KeyEvent const& key_event)
{
Tool::on_keydown(key_event);
if (key_event.key() == KeyCode::Key_Escape) {
if (m_selecting) {
m_selecting = false;
@ -160,7 +159,9 @@ void PolygonalSelectTool::on_keydown(GUI::KeyEvent& key_event)
} else {
m_editor->image().selection().clear();
}
return true;
}
return Tool::on_keydown(key_event);
}
GUI::Widget* PolygonalSelectTool::get_properties_widget()