Skip to content

Commit

Permalink
Support absolute icon paths
Browse files Browse the repository at this point in the history
  • Loading branch information
l4l committed Dec 19, 2020
1 parent 125363a commit 7474a12
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@ fn traverse_dir_entry(mut entries: &mut Vec<Entry>, dir_entry: DirEntry) {
.map(|s| s == "true")
.unwrap_or(false),
icon: main_section.attr("Icon").and_then(|name| {
icon_paths()
.and_then(|p| p.get(name))
.and_then(|icons| icons.iter().filter_map(Icon::load_icon).next())
let icon_path = Path::new(name);

if icon_path.is_absolute() {
Icon::load_icon(icon_path)
} else {
icon_paths()
.and_then(|p| p.get(name))
.and_then(|icons| icons.iter().filter_map(Icon::load_icon).next())
}
}),
});
}
Expand Down

0 comments on commit 7474a12

Please sign in to comment.