fix: card button can't be transparent when disabled

This commit is contained in:
Ashley Wulber 2024-10-23 18:36:19 -04:00 committed by Jeremy Soller
parent 5dfac9748d
commit d1aabecc16

View file

@ -122,6 +122,10 @@ impl iced_button::Catalog for Theme {
};
}
iced_button::Status::Disabled => {
// Card color is not transparent when it isn't clickable
if matches!(class, Button::Card) {
return appearance;
}
appearance.background = appearance.background.map(|background| match background {
Background::Color(color) => Background::Color(Color {
a: color.a * 0.5,