fix: use libcosmic icon with fallbacks

This commit is contained in:
Ashley Wulber 2024-01-03 13:47:52 -05:00 committed by Ashley Wulber
parent aab284f6f1
commit fdfa667f38
3 changed files with 101 additions and 518 deletions

View file

@ -264,7 +264,12 @@ impl IconSource {
fn as_cosmic_icon(&self) -> cosmic::widget::icon::Icon {
match self {
Self::Name(name) => cosmic::widget::icon::from_name(name.as_str()).into(),
Self::Name(name) => cosmic::widget::icon::from_name(name.as_str())
.fallback(Some(cosmic::widget::icon::IconFallback::Names(vec![
"application-default".into(),
"application-x-executable".into(),
])))
.into(),
Self::Path(path) => cosmic::widget::icon(cosmic::widget::icon::from_path(path.clone())),
}
}