Hide "Edit prediction" tooltip when menu is open (#23377)
Release Notes: - N/A
This commit is contained in:
parent
a22d8ef78f
commit
36c7b3eb91
1 changed files with 12 additions and 3 deletions
|
@ -18,7 +18,10 @@ use language::{
|
||||||
use settings::{update_settings_file, Settings, SettingsStore};
|
use settings::{update_settings_file, Settings, SettingsStore};
|
||||||
use std::{path::Path, sync::Arc, time::Duration};
|
use std::{path::Path, sync::Arc, time::Duration};
|
||||||
use supermaven::{AccountStatus, Supermaven};
|
use supermaven::{AccountStatus, Supermaven};
|
||||||
use ui::{ActiveTheme as _, ButtonLike, Color, Icon, IconWithIndicator, Indicator};
|
use ui::{
|
||||||
|
ActiveTheme as _, ButtonLike, Color, FluentBuilder as _, Icon, IconWithIndicator, Indicator,
|
||||||
|
PopoverMenuHandle,
|
||||||
|
};
|
||||||
use workspace::{
|
use workspace::{
|
||||||
create_and_open_local_file,
|
create_and_open_local_file,
|
||||||
item::ItemHandle,
|
item::ItemHandle,
|
||||||
|
@ -47,6 +50,7 @@ pub struct InlineCompletionButton {
|
||||||
fs: Arc<dyn Fs>,
|
fs: Arc<dyn Fs>,
|
||||||
workspace: WeakView<Workspace>,
|
workspace: WeakView<Workspace>,
|
||||||
user_store: Model<UserStore>,
|
user_store: Model<UserStore>,
|
||||||
|
zeta_popover_menu_handle: PopoverMenuHandle<ContextMenu>,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SupermavenButtonStatus {
|
enum SupermavenButtonStatus {
|
||||||
|
@ -251,7 +255,9 @@ impl Render for InlineCompletionButton {
|
||||||
|
|
||||||
let this = cx.view().clone();
|
let this = cx.view().clone();
|
||||||
let button = IconButton::new("zeta", IconName::ZedPredict)
|
let button = IconButton::new("zeta", IconName::ZedPredict)
|
||||||
.tooltip(|cx| Tooltip::text("Edit Prediction", cx));
|
.when(!self.zeta_popover_menu_handle.is_deployed(), |button| {
|
||||||
|
button.tooltip(|cx| Tooltip::text("Edit Prediction", cx))
|
||||||
|
});
|
||||||
|
|
||||||
let is_refreshing = self
|
let is_refreshing = self
|
||||||
.inline_completion_provider
|
.inline_completion_provider
|
||||||
|
@ -262,7 +268,9 @@ impl Render for InlineCompletionButton {
|
||||||
.menu(move |cx| {
|
.menu(move |cx| {
|
||||||
Some(this.update(cx, |this, cx| this.build_zeta_context_menu(cx)))
|
Some(this.update(cx, |this, cx| this.build_zeta_context_menu(cx)))
|
||||||
})
|
})
|
||||||
.anchor(Corner::BottomRight);
|
.anchor(Corner::BottomRight)
|
||||||
|
.with_handle(self.zeta_popover_menu_handle.clone());
|
||||||
|
|
||||||
if is_refreshing {
|
if is_refreshing {
|
||||||
popover_menu = popover_menu.trigger(
|
popover_menu = popover_menu.trigger(
|
||||||
button.with_animation(
|
button.with_animation(
|
||||||
|
@ -303,6 +311,7 @@ impl InlineCompletionButton {
|
||||||
language: None,
|
language: None,
|
||||||
file: None,
|
file: None,
|
||||||
inline_completion_provider: None,
|
inline_completion_provider: None,
|
||||||
|
zeta_popover_menu_handle: PopoverMenuHandle::default(),
|
||||||
workspace,
|
workspace,
|
||||||
fs,
|
fs,
|
||||||
user_store,
|
user_store,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue