From 80a360683f5625cb0e8e2b802d19565da9754905 Mon Sep 17 00:00:00 2001 From: Pierre Date: Thu, 14 May 2020 14:18:47 +0200 Subject: [PATCH] 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. --- Applications/PaintBrush/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Applications/PaintBrush/main.cpp b/Applications/PaintBrush/main.cpp index 50d53848ea..3c57fbbf8b 100644 --- a/Applications/PaintBrush/main.cpp +++ b/Applications/PaintBrush/main.cpp @@ -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_table_view.selection().set(layer_table_view.model()->index(0)); }, 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"); help_menu.add_action(GUI::Action::create("About", [&](auto&) {