mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
PaintBrush: Add 'Remove active layer' to the Menu
This allows the active Layer to be removed through the Menu or by using the shortcut Ctrl+D.
This commit is contained in:
parent
3c3c1b4013
commit
80a360683f
1 changed files with 9 additions and 0 deletions
|
@ -150,6 +150,15 @@ int main(int argc, char** argv)
|
||||||
layer_menu.add_action(GUI::Action::create("Select bottom layer", { 0, Key_End }, [&](auto&) {
|
layer_menu.add_action(GUI::Action::create("Select bottom layer", { 0, Key_End }, [&](auto&) {
|
||||||
layer_table_view.selection().set(layer_table_view.model()->index(0));
|
layer_table_view.selection().set(layer_table_view.model()->index(0));
|
||||||
}, window));
|
}, window));
|
||||||
|
layer_menu.add_separator();
|
||||||
|
layer_menu.add_action(GUI::Action::create("Remove active layer", { Mod_Ctrl , Key_D }, [&](auto&) {
|
||||||
|
auto active_layer = image_editor.active_layer();
|
||||||
|
if(!active_layer)
|
||||||
|
return;
|
||||||
|
image_editor.image()->remove_layer(*active_layer);
|
||||||
|
image_editor.set_active_layer(nullptr);
|
||||||
|
image_editor.layers_did_change();
|
||||||
|
}, window));
|
||||||
|
|
||||||
auto& help_menu = menubar->add_menu("Help");
|
auto& help_menu = menubar->add_menu("Help");
|
||||||
help_menu.add_action(GUI::Action::create("About", [&](auto&) {
|
help_menu.add_action(GUI::Action::create("About", [&](auto&) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue