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
|
// 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
|
let icon = icon_themes
|
||||||
.iter()
|
.iter()
|
||||||
.find_map(|theme| {
|
.find_map(|theme| {
|
||||||
|
|
@ -273,7 +276,9 @@ impl<'a> LookupBuilder<'a> {
|
||||||
}
|
}
|
||||||
None
|
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(|| {
|
.or_else(|| {
|
||||||
let p = PathBuf::from(&self.name);
|
let p = PathBuf::from(&self.name);
|
||||||
if let (Some(name), Some(parent)) = (p.file_stem(), p.parent()) {
|
if let (Some(name), Some(parent)) = (p.file_stem(), p.parent()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue