file_icons: Fall back to the default icon theme for icons (#23196)
This PR updates the various `FileIcons` methods to fall back to the default icon theme if the active icon theme does not have the desired icon. Release Notes: - N/A
This commit is contained in:
parent
904b367882
commit
a8526d9143
2 changed files with 45 additions and 21 deletions
|
@ -12,7 +12,7 @@ use util::ResultExt;
|
|||
|
||||
use crate::{
|
||||
read_user_theme, refine_theme_family, Appearance, IconTheme, Theme, ThemeFamily,
|
||||
ThemeFamilyContent,
|
||||
ThemeFamilyContent, DEFAULT_ICON_THEME_ID,
|
||||
};
|
||||
|
||||
/// The metadata for a theme.
|
||||
|
@ -206,6 +206,11 @@ impl ThemeRegistry {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Returns the default icon theme.
|
||||
pub fn default_icon_theme(&self) -> Result<Arc<IconTheme>> {
|
||||
self.get_icon_theme(DEFAULT_ICON_THEME_ID)
|
||||
}
|
||||
|
||||
/// Returns the icon theme with the specified name.
|
||||
pub fn get_icon_theme(&self, name: &str) -> Result<Arc<IconTheme>> {
|
||||
self.state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue