editor: Reduce selection opacity when editor is not focused (#40925)

Focus:
<img width="420" alt="image"
src="https://github.com/user-attachments/assets/97b0c7ed-8ad4-400c-9f36-01d8bd9b362d"
/>

Unfocus:
<img width="420" alt="image"
src="https://github.com/user-attachments/assets/19805293-b419-4669-8a93-e9cf41900403"
/>

Release Notes:

- Reduced selection opacity when the editor is out of focus to make
inactive states clearer.
This commit is contained in:
Smit Barmase
2025-10-23 03:57:10 +05:30
committed by GitHub
parent 7880e2b961
commit 2096f256f2
+5 -1
View File
@@ -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 {