Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

edit predictions: Put back status bar button tooltips (#24548)

Danilo Leale72f7b4e2290
diff --git a/crates/inline_completion_button/src/inline_completion_button.rs b/crates/inline_completion_button/src/inline_completion_button.rs
index c292b75f127..1b9e7309692 100644
--- a/crates/inline_completion_button/src/inline_completion_button.rs
+++ b/crates/inline_completion_button/src/inline_completion_button.rs
@@ -291,6 +291,31 @@ impl Render for InlineCompletionButton {
.when(enabled && !show_editor_predictions, |this| {
this.indicator(Indicator::dot().color(Color::Muted))
.indicator_border_color(Some(cx.theme().colors().status_bar_background))
+ })
+ .when(!self.popover_menu_handle.is_deployed(), |element| {
+ element.tooltip(move |window, cx| {
+ if enabled {
+ if show_editor_predictions {
+ Tooltip::for_action("Edit Prediction", &ToggleMenu, window, cx)
+ } else {
+ Tooltip::with_meta(
+ "Edit Prediction",
+ Some(&ToggleMenu),
+ "Hidden For This File",
+ window,
+ cx,
+ )
+ }
+ } else {
+ Tooltip::with_meta(
+ "Edit Prediction",
+ Some(&ToggleMenu),
+ "Disabled For This File",
+ window,
+ cx,
+ )
+ }
+ })
});
let this = cx.entity().clone();