mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +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:
parent
967dfa7956
commit
7ce346e50e
19 changed files with 62 additions and 41 deletions
|
@ -130,14 +130,14 @@ void RectangleTool::on_second_paint(Layer const* layer, GUI::PaintEvent& event)
|
|||
draw_using(painter, start_position, end_position, AK::max(m_thickness * m_editor->scale(), 1), m_corner_radius * m_editor->scale());
|
||||
}
|
||||
|
||||
void RectangleTool::on_keydown(GUI::KeyEvent& event)
|
||||
bool RectangleTool::on_keydown(GUI::KeyEvent const& event)
|
||||
{
|
||||
Tool::on_keydown(event);
|
||||
if (event.key() == Key_Escape && m_drawing_button != GUI::MouseButton::None) {
|
||||
m_drawing_button = GUI::MouseButton::None;
|
||||
m_editor->update();
|
||||
event.accept();
|
||||
return true;
|
||||
}
|
||||
return Tool::on_keydown(event);
|
||||
}
|
||||
|
||||
GUI::Widget* RectangleTool::get_properties_widget()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue