fix: Fallback to using the hicolor theme if the selected theme doesn't exist
This commit is contained in:
parent
5e8d39a7a7
commit
c7914692a2
1 changed files with 51 additions and 46 deletions
|
|
@ -235,7 +235,10 @@ impl<'a> LookupBuilder<'a> {
|
|||
}
|
||||
|
||||
// Then lookup in the given theme
|
||||
THEMES.get(self.theme).and_then(|icon_themes| {
|
||||
THEMES
|
||||
.get(self.theme)
|
||||
.or_else(|| THEMES.get("hicolor"))
|
||||
.and_then(|icon_themes| {
|
||||
let icon = icon_themes
|
||||
.iter()
|
||||
.find_map(|theme| {
|
||||
|
|
@ -273,7 +276,9 @@ impl<'a> LookupBuilder<'a> {
|
|||
}
|
||||
None
|
||||
})
|
||||
.or_else(|| try_build_icon_path(self.name, "/usr/share/pixmaps", self.force_svg))
|
||||
.or_else(|| {
|
||||
try_build_icon_path(self.name, "/usr/share/pixmaps", self.force_svg)
|
||||
})
|
||||
.or_else(|| {
|
||||
let p = PathBuf::from(&self.name);
|
||||
if let (Some(name), Some(parent)) = (p.file_stem(), p.parent()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue