mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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
Notes:
sideshowbarker
2024-07-17 09:39:38 +09:00
Author: https://github.com/tslater2006
Commit: dc5402f61e
Pull-request: https://github.com/SerenityOS/serenity/pull/15678
Reviewed-by: https://github.com/awesomekling
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