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.
This commit is contained in:
parent
765286f691
commit
f54164e8ae
Notes:
sideshowbarker
2024-07-18 12:14:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f54164e8ae4
1 changed files with 3 additions and 1 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue