button: Use primary or danger color for the disable background. (#252)

<img width="1624" alt="image"
src="https://github.com/user-attachments/assets/61162ba5-9188-4cad-a154-2584abd0fd31">

Fix #251
This commit is contained in:
Jason Lee 2024-09-17 21:01:06 +08:00 committed by GitHub
parent 8f0ba2e5c3
commit d641c219a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -592,6 +592,8 @@ impl ButtonStyle {
fn disabled(&self, cx: &WindowContext) -> ButtonStyles {
let bg = match self {
ButtonStyle::Link | ButtonStyle::Ghost | ButtonStyle::Text => cx.theme().transparent,
ButtonStyle::Primary => cx.theme().primary.opacity(0.15),
ButtonStyle::Danger => cx.theme().destructive.opacity(0.15),
_ => cx.theme().secondary.darken(0.2).grayscale(),
};
let fg = match self {