From 23f6fc8358e9e117bac372468f230f493f3cea5b Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 6 May 2024 18:49:32 -0400 Subject: [PATCH] fix(applet): set the svg style to default if the icon is not symbolic --- src/applet/mod.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/applet/mod.rs b/src/applet/mod.rs index 35bf42d4..61e9cef9 100644 --- a/src/applet/mod.rs +++ b/src/applet/mod.rs @@ -151,15 +151,18 @@ impl Context { &self, icon: widget::icon::Handle, ) -> crate::widget::Button<'a, Message, crate::Theme, Renderer> { - let suggested = self.suggested_size(icon.symbolic); - let applet_padding = self.suggested_padding(icon.symbolic); + let symbolic = icon.symbolic; + let suggested = self.suggested_size(symbolic); + let applet_padding = self.suggested_padding(symbolic); crate::widget::button( widget::icon(icon) - .style(theme::Svg::Custom(Rc::new(|theme| { - crate::iced_style::svg::Appearance { + .style(if symbolic { + theme::Svg::Custom(Rc::new(|theme| crate::iced_style::svg::Appearance { color: Some(theme.cosmic().background.on.into()), - } - }))) + })) + } else { + theme::Svg::default() + }) .width(Length::Fixed(suggested.0 as f32)) .height(Length::Fixed(suggested.1 as f32)), )