mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
PixelPaint: Clear selection with escape key regardless of active tool
This makes ImageEditor responsible for clearing the active selection when the escape key is pressed. If the active tool didn't act on the Escape key (like some selection tools use this to indicate cancelling of making a new selection), then ImageEditor will check for an active selection and clear it.
This commit is contained in:
parent
d6bb110d89
commit
dc5402f61e
1 changed files with 5 additions and 0 deletions
|
@ -423,6 +423,11 @@ void ImageEditor::keydown_event(GUI::KeyEvent& event)
|
|||
if (m_active_tool && m_active_tool->on_keydown(event))
|
||||
return;
|
||||
|
||||
if (event.key() == Key_Escape && !m_image->selection().is_empty()) {
|
||||
m_image->selection().clear();
|
||||
return;
|
||||
}
|
||||
|
||||
event.ignore();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue