From c7dc5ab1edad2a231aeb6468f34a65eba267cfca Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Fri, 17 May 2024 19:07:42 +0200 Subject: [PATCH] fix(button): icon buttons should inherit text and icon color from container --- src/theme/style/button.rs | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/theme/style/button.rs b/src/theme/style/button.rs index e1898ee..0509d62 100644 --- a/src/theme/style/button.rs +++ b/src/theme/style/button.rs @@ -13,27 +13,27 @@ use crate::{ #[derive(Default)] pub enum Button { + AppletIcon, Custom { active: Box Appearance>, disabled: Box Appearance>, hovered: Box Appearance>, pressed: Box Appearance>, }, + AppletMenu, Destructive, - Link, - Icon, HeaderBar, + Icon, IconVertical, Image, + Link, + MenuItem, + MenuRoot, #[default] Standard, Suggested, Text, Transparent, - AppletMenu, - AppletIcon, - MenuRoot, - MenuItem, } pub fn appearance( @@ -76,8 +76,6 @@ pub fn appearance( } let (background, text, icon) = color(&cosmic.icon_button); - appearance.text_color = text; - appearance.icon_color = icon; appearance.background = Some(Background::Color(background)); } @@ -162,10 +160,6 @@ impl StyleSheet for crate::Theme { ) && selected { Some(self.cosmic().accent_color().into()) - } else if matches!(style, Button::HeaderBar) && !selected { - let mut c = Color::from(self.cosmic().background.on); - c.a = 0.75; - Some(c) } else { Some(component.on.into()) }; @@ -211,10 +205,6 @@ impl StyleSheet for crate::Theme { ) && selected { Some(self.cosmic().accent_color().into()) - } else if matches!(style, Button::HeaderBar) && !selected { - let mut c = Color::from(component.on); - c.a = 0.8; - Some(c) } else { Some(component.on.into()) }; @@ -236,10 +226,6 @@ impl StyleSheet for crate::Theme { ) && selected { Some(self.cosmic().accent_color().into()) - } else if matches!(style, Button::HeaderBar) && !selected { - let mut c = Color::from(component.on); - c.a = 0.8; - Some(c) } else { Some(component.on.into()) };