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

These were wrongly removed in
https://github.com/zed-industries/zed/pull/24540; putting them back.

cc @SomeoneToIgnore 

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2025-02-10 08:19:46 -03:00 committed by GitHub
parent d0c4c664b0
commit e72f7b4e22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();