mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
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
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");
|
auto layer = PixelPaint::Layer::try_create_with_bitmap(*image_editor.image(), *bitmap, "Pasted layer");
|
||||||
VERIFY(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) {
|
GUI::Clipboard::the().on_change = [&](auto& mime_type) {
|
||||||
paste_action->set_enabled(mime_type == "image/x-serenityos");
|
paste_action->set_enabled(mime_type == "image/x-serenityos");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue