button: Fix loading style when disabled. (#1021)

## Before

<img width="1193" alt="image"
src="https://github.com/user-attachments/assets/e7a82f21-2ec8-42fa-8daa-05d4f086e0b2"
/>

## After

<img width="1196" alt="image"
src="https://github.com/user-attachments/assets/f387c591-a4a1-4220-9318-badfb8a133e6"
/>
This commit is contained in:
Jason Lee 2025-06-30 15:44:26 +08:00 committed by GitHub
parent deb1187c40
commit 646b8b7206
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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())