From 586a5debe7b37d5782282bf12cb01383ad5ef61d Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Tue, 19 Sep 2023 16:36:42 +0200 Subject: [PATCH] feat(theme): add `Button::Transparent` style --- src/theme/style/button.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/theme/style/button.rs b/src/theme/style/button.rs index b4ea8306..18dbfb41 100644 --- a/src/theme/style/button.rs +++ b/src/theme/style/button.rs @@ -7,7 +7,10 @@ use cosmic_theme::Component; use iced_core::{Background, Color}; use palette::{rgb::Rgb, Alpha}; -use crate::widget::button::{Appearance, StyleSheet}; +use crate::{ + theme::TRANSPARENT_COMPONENT, + widget::button::{Appearance, StyleSheet}, +}; #[derive(Default)] pub enum Button { @@ -25,6 +28,7 @@ pub enum Button { Standard, Suggested, Text, + Transparent, } pub fn appearance( @@ -38,12 +42,17 @@ pub fn appearance( let mut appearance = Appearance::new(); match style { - Button::Standard | Button::Text | Button::Suggested | Button::Destructive => { + Button::Standard + | Button::Text + | Button::Suggested + | Button::Destructive + | Button::Transparent => { let style_component = match style { Button::Standard => &cosmic.button, Button::Text => &cosmic.text_button, Button::Suggested => &cosmic.accent_button, Button::Destructive => &cosmic.destructive_button, + Button::Transparent => &TRANSPARENT_COMPONENT, _ => return appearance, };