diff --git a/crates/story/src/menu_story.rs b/crates/story/src/menu_story.rs index 58edeb99..9bf7b9c7 100644 --- a/crates/story/src/menu_story.rs +++ b/crates/story/src/menu_story.rs @@ -169,6 +169,8 @@ impl Render for MenuStory { }, ) .separator() + .menu_with_disabled("Disabled Item", Box::new(Info(0)), true) + .separator() .submenu("Links", window, cx, |menu, _, _| { menu.link_with_icon( "GitHub Repository", diff --git a/crates/ui/src/button/button.rs b/crates/ui/src/button/button.rs index b62dca50..ab45f4f9 100644 --- a/crates/ui/src/button/button.rs +++ b/crates/ui/src/button/button.rs @@ -469,8 +469,7 @@ impl RenderOnce for Button { ) .when(self.disabled, |this| { let disabled_style = style.disabled(self.outline, cx); - this.cursor_not_allowed() - .bg(disabled_style.bg) + this.bg(disabled_style.bg) .text_color(disabled_style.fg) .border_color(disabled_style.border) .shadow_none() diff --git a/crates/ui/src/checkbox.rs b/crates/ui/src/checkbox.rs index e2d7af4c..b0f35e21 100644 --- a/crates/ui/src/checkbox.rs +++ b/crates/ui/src/checkbox.rs @@ -181,8 +181,7 @@ impl RenderOnce for Checkbox { ) }) .when(self.disabled, |this| { - this.cursor_not_allowed() - .text_color(cx.theme().muted_foreground) + this.text_color(cx.theme().muted_foreground) }) .when_some( self.on_click.filter(|_| !self.disabled), diff --git a/crates/ui/src/dropdown.rs b/crates/ui/src/dropdown.rs index 17ad57be..921473d7 100644 --- a/crates/ui/src/dropdown.rs +++ b/crates/ui/src/dropdown.rs @@ -575,8 +575,7 @@ where }; title.when(self.disabled, |this| { - this.cursor_not_allowed() - .text_color(cx.theme().muted_foreground) + this.text_color(cx.theme().muted_foreground) }) } } @@ -648,13 +647,7 @@ where .border_color(cx.theme().input) .rounded(cx.theme().radius) .when(cx.theme().shadow, |this| this.shadow_sm()) - .map(|this| { - if self.disabled { - this.cursor_not_allowed() - } else { - this - } - }) + .map(|this| if self.disabled { this } else { this }) .overflow_hidden() .input_text_size(self.size) .map(|this| match self.width { @@ -701,15 +694,12 @@ where } }; - this.child( - Icon::new(icon) - .xsmall() - .text_color(match self.disabled { - true => cx.theme().muted_foreground.opacity(0.5), - false => cx.theme().muted_foreground, - }) - .when(self.disabled, |this| this.cursor_not_allowed()), - ) + this.child(Icon::new(icon).xsmall().text_color( + match self.disabled { + true => cx.theme().muted_foreground.opacity(0.5), + false => cx.theme().muted_foreground, + }, + )) }), ) .child( diff --git a/crates/ui/src/list/list_item.rs b/crates/ui/src/list/list_item.rs index 66b10d17..1531fce1 100644 --- a/crates/ui/src/list/list_item.rs +++ b/crates/ui/src/list/list_item.rs @@ -143,8 +143,7 @@ impl RenderOnce for ListItem { }) }) .when(self.disabled, |this| { - this.cursor_not_allowed() - .text_color(cx.theme().muted_foreground) + this.text_color(cx.theme().muted_foreground) }) .child( h_flex() diff --git a/crates/ui/src/switch.rs b/crates/ui/src/switch.rs index dfe14ced..7ac6335f 100644 --- a/crates/ui/src/switch.rs +++ b/crates/ui/src/switch.rs @@ -172,7 +172,6 @@ impl Element for Switch { .border(inset) .border_color(cx.theme().transparent) .bg(bg) - .when(self.disabled, |this| this.cursor_not_allowed()) .when_some(self.tooltip.clone(), |this, tooltip| { this.tooltip(move |window, cx| { Tooltip::new(tooltip.clone()).build(window, cx) diff --git a/crates/ui/src/tab/tab.rs b/crates/ui/src/tab/tab.rs index d70bf8c5..04f1a3fd 100644 --- a/crates/ui/src/tab/tab.rs +++ b/crates/ui/src/tab/tab.rs @@ -583,7 +583,6 @@ impl RenderOnce for Tab { .flex_wrap() .items_center() .flex_shrink_0() - .when(self.disabled, |this| this.cursor_not_allowed()) .overflow_hidden() .h(height) .overflow_hidden() diff --git a/crates/ui/src/time/calendar.rs b/crates/ui/src/time/calendar.rs index 806d1895..4b61cb34 100644 --- a/crates/ui/src/time/calendar.rs +++ b/crates/ui/src/time/calendar.rs @@ -473,13 +473,6 @@ impl Calendar { _ => this.size_9().rounded(cx.theme().radius * 2.), }) .justify_center() - .map(|this| { - if disabled { - this.cursor_not_allowed() - } else { - this - } - }) .when(muted, |this| { this.text_color(if disabled { cx.theme().muted_foreground.opacity(0.3)