Add icon theme selector (#23976)
This PR adds an icon theme selector for switching between icon themes: https://github.com/user-attachments/assets/2cdc7ab7-d9f4-4968-a2e9-724e8ad4ef4d Release Notes: - N/A
This commit is contained in:
parent
e23e03592b
commit
7adf9cb1a0
4 changed files with 330 additions and 6 deletions
|
@ -212,6 +212,19 @@ impl ThemeRegistry {
|
|||
self.get_icon_theme(DEFAULT_ICON_THEME_NAME)
|
||||
}
|
||||
|
||||
/// Returns the metadata of all icon themes in the registry.
|
||||
pub fn list_icon_themes(&self) -> Vec<ThemeMeta> {
|
||||
self.state
|
||||
.read()
|
||||
.icon_themes
|
||||
.values()
|
||||
.map(|theme| ThemeMeta {
|
||||
name: theme.name.clone(),
|
||||
appearance: theme.appearance,
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// 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