1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:27:35 +00:00

PixelPaint: Add menu items for Select All and Clear Selection

We also need to update the image editor when clearing selection
otherwise the last state of the selection will be displayed until an
update happens.
This commit is contained in:
LepkoQQ 2021-06-14 22:26:15 +02:00 committed by Andreas Kling
parent 472721b774
commit db99e0917c
3 changed files with 20 additions and 1 deletions

View file

@ -207,6 +207,19 @@ int main(int argc, char** argv)
});
edit_menu.add_action(redo_action);
edit_menu.add_separator();
edit_menu.add_action(GUI::CommonActions::make_select_all_action([&](auto&) {
VERIFY(image_editor.image());
if (!image_editor.active_layer())
return;
image_editor.selection().set(image_editor.active_layer()->relative_rect());
}));
edit_menu.add_action(GUI::Action::create(
"Clear &Selection", { Mod_Ctrl | Mod_Shift, Key_A }, [&](auto&) {
image_editor.selection().clear();
},
window));
auto& view_menu = menubar->add_menu("&View");
auto zoom_in_action = GUI::CommonActions::make_zoom_in_action(