mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
PixelPaint: Record action for all select operations to allow undo
Since selections with the select tools support undo, it makes sense for the edit operations 'select all', 'none', 'invert' and 'clear selection' to also support undo.
This commit is contained in:
parent
427d488d7e
commit
8cca9e94a2
Notes:
sideshowbarker
2024-07-17 03:51:47 +09:00
Author: https://github.com/andreao
Commit: 8cca9e94a2
Pull-request: https://github.com/SerenityOS/serenity/pull/16214
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 4 additions and 0 deletions
|
@ -359,18 +359,21 @@ void MainWidget::initialize_menubar(GUI::Window& window)
|
|||
if (!editor->active_layer())
|
||||
return;
|
||||
editor->image().selection().merge(editor->active_layer()->relative_rect(), PixelPaint::Selection::MergeMode::Set);
|
||||
editor->did_complete_action("Select All"sv);
|
||||
}));
|
||||
m_edit_menu->add_action(GUI::Action::create(
|
||||
"Clear &Selection", g_icon_bag.clear_selection, [&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
VERIFY(editor);
|
||||
editor->image().selection().clear();
|
||||
editor->did_complete_action("Clear Selection"sv);
|
||||
}));
|
||||
m_edit_menu->add_action(GUI::Action::create(
|
||||
"&Invert Selection", g_icon_bag.invert_selection, [&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
VERIFY(editor);
|
||||
editor->image().selection().invert();
|
||||
editor->did_complete_action("Invert Selection"sv);
|
||||
}));
|
||||
|
||||
m_edit_menu->add_separator();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue