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.

ui: Don't show tooltip when ButtonLike is selected (#13857)

Thorsten Ballf2711b2fca99
diff --git a/crates/ui/src/components/button/button_like.rs b/crates/ui/src/components/button/button_like.rs
index ee865fa364d..3fea9d867c5 100644
--- a/crates/ui/src/components/button/button_like.rs
+++ b/crates/ui/src/components/button/button_like.rs
@@ -507,8 +507,10 @@ impl RenderOnce for ButtonLike {
})
},
)
- .when_some(self.tooltip, |this, tooltip| {
- this.tooltip(move |cx| tooltip(cx))
+ .when(!self.selected, |this| {
+ this.when_some(self.tooltip, |this, tooltip| {
+ this.tooltip(move |cx| tooltip(cx))
+ })
})
.children(self.children)
}