pub struct IconSetRegistry { /* private fields */ }Expand description
All icon sets known to an application: the built-in ones plus the application’s own.
A set is drawn when a theme names it ([meta] icon-set). Keys of the application’s sets that
the built-in set does not have, such as category.internet, are drawn whatever set is chosen:
they sit under the chosen set, so a theme’s set or single icon can still restyle them, and a
set added later wins a key two application sets give. A key the built-in set already has, such
as check, is a restyling of the framework’s own icon, which every widget draws; it applies
only while its set is the chosen one, so an application set never changes the icons of a set
the user picked.
Implementations§
Source§impl IconSetRegistry
impl IconSetRegistry
Sourcepub fn add_source(&mut self, id: &str, file: &str, text: &str) -> bool
pub fn add_source(&mut self, id: &str, file: &str, text: &str) -> bool
Adds or replaces the icon set id from TOML text. Returns whether it was usable.
Its keys the built-in set lacks are drawn in every set from then on; see
IconSetRegistry for how it layers with the chosen set.
Sourcepub fn load_dir(&mut self, dir: &Path) -> Result<()>
pub fn load_dir(&mut self, dir: &Path) -> Result<()>
Loads every *.toml file in dir; the file stem is the set id.
§Errors
Returns the I/O error when the directory cannot be read. A file that cannot be read is skipped and reported in the diagnostics.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Problems found while loading.
Sourcepub fn icons(
&self,
id: &str,
overrides: &BTreeMap<String, IconGlyphs>,
mode: GlyphMode,
) -> Icons
pub fn icons( &self, id: &str, overrides: &BTreeMap<String, IconGlyphs>, mode: GlyphMode, ) -> Icons
Builds the icons for set id with overrides applied on top.
An unknown id falls back to the built-in default set.
Sourcepub fn icons_with_animations(
&self,
id: &str,
overrides: &BTreeMap<String, IconGlyphs>,
animations: &BTreeMap<String, Arc<CellAnimation>>,
mode: GlyphMode,
) -> Icons
pub fn icons_with_animations( &self, id: &str, overrides: &BTreeMap<String, IconGlyphs>, animations: &BTreeMap<String, Arc<CellAnimation>>, mode: GlyphMode, ) -> Icons
Builds the icons and animations for set id, with icon overrides and animations (such
as a theme’s) applied on top.
Animations layer from the built-in default set, through set id, to the overrides, so a
set or theme without animations still has every built-in one. Within a layer, a former
spinner icon key such as spinner-arc first replaces the glyphs of its animation, then the
layer’s own animations apply. An unknown id falls back to the built-in default set.
Trait Implementations§
Source§impl Clone for IconSetRegistry
impl Clone for IconSetRegistry
Source§fn clone(&self) -> IconSetRegistry
fn clone(&self) -> IconSetRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for IconSetRegistry
impl RefUnwindSafe for IconSetRegistry
impl Send for IconSetRegistry
impl Sync for IconSetRegistry
impl Unpin for IconSetRegistry
impl UnsafeUnpin for IconSetRegistry
impl UnwindSafe for IconSetRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more