From f54164e8ae49e9e5ef64f5941cc6e07c53c79936 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 14 Jun 2021 18:01:46 +0200 Subject: [PATCH] PixelPaint: Make new pasted layer active immediately Also clear any selection that existed before pasting. This feels a bit more intuitive. We may also want to consider switching to the "Move" tool automatically on paste, but I'm less sure about that. --- Userland/Applications/PixelPaint/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/PixelPaint/main.cpp b/Userland/Applications/PixelPaint/main.cpp index 18a0d9aa6a..797ba26300 100644 --- a/Userland/Applications/PixelPaint/main.cpp +++ b/Userland/Applications/PixelPaint/main.cpp @@ -183,7 +183,9 @@ int main(int argc, char** argv) auto layer = PixelPaint::Layer::try_create_with_bitmap(*image_editor.image(), *bitmap, "Pasted layer"); VERIFY(layer); - image_editor.image()->add_layer(layer.release_nonnull()); + image_editor.image()->add_layer(*layer); + image_editor.set_active_layer(layer); + image_editor.selection().clear(); }); GUI::Clipboard::the().on_change = [&](auto& mime_type) { paste_action->set_enabled(mime_type == "image/x-serenityos");