From 2096f256f2ba5a3ebe9abf9e242130a04d12df00 Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Thu, 23 Oct 2025 03:57:10 +0530 Subject: [PATCH] editor: Reduce selection opacity when editor is not focused (#40925) Focus: image Unfocus: image Release Notes: - Reduced selection opacity when the editor is out of focus to make inactive states clearer. --- crates/editor/src/element.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index b5c1fecbea003d15e336738d7e68e1c4ec59f14f..efb0bf9a1e5c8a7704eb776e050bc36b4539a99e 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1422,7 +1422,11 @@ impl EditorElement { layouts.push(layout); } - let player = editor.current_user_player_color(cx); + let mut player = editor.current_user_player_color(cx); + if !editor.is_focused(window) { + const UNFOCUS_EDITOR_SELECTION_OPACITY: f32 = 0.5; + player.selection = player.selection.opacity(UNFOCUS_EDITOR_SELECTION_OPACITY); + } selections.push((player, layouts)); if let SelectionDragState::Dragging {