From 07f1b612cf4451c9a5f3a85cc153fd68df2e2833 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 7 Feb 2025 17:58:20 -0300 Subject: [PATCH] edit predictions: Fix translucent "jump to edit" background color (#24473) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR uses a pretty cool GPUI method called `blend` to make this callout's background color not translucent. | Before | Header | |--------|--------| | Screenshot 2025-02-07 at 4 58 16 PM | Screenshot 2025-02-07 at 4 56 48 PM | Release Notes: - N/A --- crates/editor/src/element.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 04bcf72262..fe829e2ad6 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -5800,6 +5800,9 @@ fn inline_completion_accept_indicator( .child(accept_keystroke.key.clone()); let padding_right = if icon.is_some() { px(4.) } else { px(8.) }; + let accent_color = cx.theme().colors().text_accent; + let editor_bg_color = cx.theme().colors().editor_background; + let bg_color = editor_bg_color.blend(accent_color.opacity(0.2)); Some( h_flex() @@ -5807,7 +5810,7 @@ fn inline_completion_accept_indicator( .pl_1() .pr(padding_right) .gap_1() - .bg(cx.theme().colors().text_accent.opacity(0.15)) + .bg(bg_color) .border_1() .border_color(cx.theme().colors().text_accent.opacity(0.8)) .rounded_md()