Fix code actions tooltip overlapping with action context menu (#27809)
Closes #27728 This stops code actions tooltip from being added when there's a visible Editor::context_menu Release Notes: - Fix code actions tooltip opening on top of code actions menu
This commit is contained in:
parent
7984f0f11c
commit
63f0fda350
1 changed files with 16 additions and 13 deletions
|
@ -6180,6 +6180,7 @@ impl Editor {
|
||||||
) -> Option<IconButton> {
|
) -> Option<IconButton> {
|
||||||
let color = Color::Muted;
|
let color = Color::Muted;
|
||||||
let position = breakpoint.as_ref().map(|(anchor, _)| *anchor);
|
let position = breakpoint.as_ref().map(|(anchor, _)| *anchor);
|
||||||
|
let show_tooltip = !self.context_menu_visible();
|
||||||
|
|
||||||
if self.available_code_actions.is_some() {
|
if self.available_code_actions.is_some() {
|
||||||
Some(
|
Some(
|
||||||
|
@ -6188,19 +6189,21 @@ impl Editor {
|
||||||
.icon_size(IconSize::XSmall)
|
.icon_size(IconSize::XSmall)
|
||||||
.icon_color(color)
|
.icon_color(color)
|
||||||
.toggle_state(is_active)
|
.toggle_state(is_active)
|
||||||
.tooltip({
|
.when(show_tooltip, |this| {
|
||||||
let focus_handle = self.focus_handle.clone();
|
this.tooltip({
|
||||||
move |window, cx| {
|
let focus_handle = self.focus_handle.clone();
|
||||||
Tooltip::for_action_in(
|
move |window, cx| {
|
||||||
"Toggle Code Actions",
|
Tooltip::for_action_in(
|
||||||
&ToggleCodeActions {
|
"Toggle Code Actions",
|
||||||
deployed_from_indicator: None,
|
&ToggleCodeActions {
|
||||||
},
|
deployed_from_indicator: None,
|
||||||
&focus_handle,
|
},
|
||||||
window,
|
&focus_handle,
|
||||||
cx,
|
window,
|
||||||
)
|
cx,
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.on_click(cx.listener(move |editor, _e, window, cx| {
|
.on_click(cx.listener(move |editor, _e, window, cx| {
|
||||||
window.focus(&editor.focus_handle(cx));
|
window.focus(&editor.focus_handle(cx));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue