From e8f89e04d68af59c311070ca70e2577c9be0f86a Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Thu, 27 Mar 2025 10:43:40 +0800 Subject: [PATCH] button: Update ButtonCustomVariant default variable value to use transparent. (#746) --- crates/ui/src/button/button.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/ui/src/button/button.rs b/crates/ui/src/button/button.rs index 2c993cf8..b5fda197 100644 --- a/crates/ui/src/button/button.rs +++ b/crates/ui/src/button/button.rs @@ -85,40 +85,46 @@ pub trait ButtonVariants: Sized { impl ButtonCustomVariant { pub fn new(cx: &App) -> Self { Self { - color: cx.theme().secondary, - foreground: cx.theme().secondary_foreground, - border: cx.theme().border, - hover: cx.theme().secondary_hover, - active: cx.theme().secondary_active, - shadow: true, + color: cx.theme().transparent, + foreground: cx.theme().foreground, + border: cx.theme().transparent, + hover: cx.theme().transparent, + active: cx.theme().transparent, + shadow: false, } } + /// Set background color, default is transparent. pub fn color(mut self, color: Hsla) -> Self { self.color = color; self } + /// Set foreground color, default is theme foreground. pub fn foreground(mut self, color: Hsla) -> Self { self.foreground = color; self } + /// Set border color, default is transparent. pub fn border(mut self, color: Hsla) -> Self { self.border = color; self } + /// Set hover background color, default is transparent. pub fn hover(mut self, color: Hsla) -> Self { self.hover = color; self } + /// Set active background color, default is transparent. pub fn active(mut self, color: Hsla) -> Self { self.active = color; self } + /// Set shadow, default is false. pub fn shadow(mut self, shadow: bool) -> Self { self.shadow = shadow; self