From 646b8b7206995fdf97fc8bcab13a7e775a7e0edc Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 30 Jun 2025 15:44:26 +0800 Subject: [PATCH] button: Fix loading style when disabled. (#1021) ## Before image ## After image --- crates/ui/src/button/button.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui/src/button/button.rs b/crates/ui/src/button/button.rs index b1b85a76..a3f84b90 100644 --- a/crates/ui/src/button/button.rs +++ b/crates/ui/src/button/button.rs @@ -520,7 +520,11 @@ impl RenderOnce for Button { }) .children(self.children) }) - .when(self.loading, |this| this.bg(normal_style.bg.opacity(0.8))) + .when(self.loading && !self.disabled, |this| { + this.bg(normal_style.bg.opacity(0.8)) + .border_color(normal_style.border.opacity(0.8)) + .text_color(normal_style.fg.opacity(0.8)) + }) .when_some(self.tooltip, |this, (tooltip, action)| { this.tooltip(move |window, cx| { Tooltip::new(tooltip.clone())