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.

Respect cursor_pointer when a ButtonLike is disabled (#29737)

Richard Feldmand7e181576e20
diff --git a/crates/ui/src/components/button/button_like.rs b/crates/ui/src/components/button/button_like.rs
index 5c4ac215981..b4907ac0626 100644
--- a/crates/ui/src/components/button/button_like.rs
+++ b/crates/ui/src/components/button/button_like.rs
@@ -535,9 +535,15 @@ impl RenderOnce for ButtonLike {
ButtonSize::None => this,
})
.bg(style.enabled(self.layer, cx).background)
- .when(self.disabled, |this| this.cursor_not_allowed())
+ .when(self.disabled, |this| {
+ if self.cursor_style == CursorStyle::PointingHand {
+ this.cursor_not_allowed()
+ } else {
+ this.cursor(self.cursor_style)
+ }
+ })
.when(!self.disabled, |this| {
- this.cursor_pointer()
+ this.cursor(self.cursor_style)
.hover(|hover| hover.bg(style.hovered(self.layer, cx).background))
.active(|active| active.bg(style.active(cx).background))
})