Skip to content

Commit 7474a12

Browse files
committed
Support absolute icon paths
1 parent 125363a commit 7474a12

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/desktop.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,15 @@ fn traverse_dir_entry(mut entries: &mut Vec<Entry>, dir_entry: DirEntry) {
9898
.map(|s| s == "true")
9999
.unwrap_or(false),
100100
icon: main_section.attr("Icon").and_then(|name| {
101-
icon_paths()
102-
.and_then(|p| p.get(name))
103-
.and_then(|icons| icons.iter().filter_map(Icon::load_icon).next())
101+
let icon_path = Path::new(name);
102+
103+
if icon_path.is_absolute() {
104+
Icon::load_icon(icon_path)
105+
} else {
106+
icon_paths()
107+
.and_then(|p| p.get(name))
108+
.and_then(|icons| icons.iter().filter_map(Icon::load_icon).next())
109+
}
104110
}),
105111
});
106112
}

0 commit comments

Comments
 (0)