fix!(desktop): IconSourceExt::as_cosmic_icon should return Handle with SVG preference
This commit is contained in:
parent
e9bb5ed97d
commit
421552dea1
1 changed files with 5 additions and 6 deletions
|
|
@ -7,23 +7,22 @@ use std::path::{Path, PathBuf};
|
|||
use std::{borrow::Cow, collections::HashSet, ffi::OsStr};
|
||||
|
||||
pub trait IconSourceExt {
|
||||
fn as_cosmic_icon(&self) -> crate::widget::icon::Icon;
|
||||
fn as_cosmic_icon(&self) -> crate::widget::icon::Handle;
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
impl IconSourceExt for fde::IconSource {
|
||||
fn as_cosmic_icon(&self) -> crate::widget::icon::Icon {
|
||||
fn as_cosmic_icon(&self) -> crate::widget::icon::Handle {
|
||||
match self {
|
||||
fde::IconSource::Name(name) => crate::widget::icon::from_name(name.as_str())
|
||||
.prefer_svg(true)
|
||||
.size(128)
|
||||
.fallback(Some(crate::widget::icon::IconFallback::Names(vec![
|
||||
"application-default".into(),
|
||||
"application-x-executable".into(),
|
||||
])))
|
||||
.into(),
|
||||
fde::IconSource::Path(path) => {
|
||||
crate::widget::icon(crate::widget::icon::from_path(path.clone()))
|
||||
}
|
||||
.handle(),
|
||||
fde::IconSource::Path(path) => crate::widget::icon::from_path(path.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue