1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 19:34:24 +02:00

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
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61

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 {