From 18aa6a199b05aec4ac8eb6ffa9875cf1d65f326c Mon Sep 17 00:00:00 2001 From: Korg1ch <57859048+Korg1ch@users.noreply.github.com> Date: Wed, 21 Oct 2026 05:28:31 +0300 Subject: [PATCH] fix(ui-egui): a click on the empty Layers panel space deselects every layer, as in Photoshop (#8100) --- crates/ui-egui/src/panels.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 18cef34c98..9132f93dbf 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -2633,6 +2633,10 @@ fn layers(app: &mut PhotocraftApp, ui: &mut egui::Ui) { if let Some(&(last, last_rect)) = drawn.last() { let below = Rect::from_min_max(pos2(last_rect.left(), last_rect.bottom()), pos2(last_rect.right(), ui.clip_rect().bottom())); layer_drop_zone(app, &ctx, ui, below, (last, last_rect), "below", &mut actions); + // A click on that empty space deselects every layer, as in Photoshop (#8100). + if below.height() > 0.0 && ui.interact(below, ui.id().with("layers-empty-space"), Sense::click()).clicked() && !selection.is_empty() { + actions.push(("select.deselectLayers".into(), json!({}))); + } } // Tab / ⇧Tab in a rename: rename the layer below / above next, as in Photoshop. The // Background isn't renamed in place (double-clicking it converts it), so it ends there.