fix(focused): previous icon does not clear if new icon fails to load

Fixes #169
This commit is contained in:
Jake Stanger
2023-06-17 16:43:58 +01:00
parent ac34c05d2e
commit de3aa5d7b1

View File

@@ -115,8 +115,12 @@ impl Module<gtk::Box> for FocusedModule {
let icon_theme = icon_theme.clone();
context.widget_rx.attach(None, move |(name, id)| {
if self.show_icon {
ImageProvider::parse(&id, &icon_theme, self.icon_size)
.map(|image| image.load_into_image(icon.clone()));
match ImageProvider::parse(&id, &icon_theme, self.icon_size)
.map(|image| image.load_into_image(icon.clone()))
{
Some(Ok(_)) => icon.show(),
_ => icon.hide(),
}
}
if self.show_title {