From d641c219a10242fbe15dcf54d1a8a459ebfba579 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 17 Sep 2024 21:01:06 +0800 Subject: [PATCH] button: Use primary or danger color for the disable background. (#252) image Fix #251 --- crates/ui/src/button.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ui/src/button.rs b/crates/ui/src/button.rs index b75acc5e..3603e9cb 100644 --- a/crates/ui/src/button.rs +++ b/crates/ui/src/button.rs @@ -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 {