FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ColorPaletteResourcesCollection

    struct · ferroui-themes-fluent · v0.5.0

    struct ColorPaletteResourcesCollection
    

    The colour palettes of a FluentTheme by theme variant: a dictionary that is also the resource provider of the palette of the requested variant.

    The managed class implements IDictionary<ThemeVariant, ColorPaletteResources> over an inner observable dictionary; here the dictionary members are inherent methods.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<ColorPaletteResourcesCollection>
    

    Returns a strong reference to this object.

    Source

    construct

    fn construct() -> Self
    

    Field initialisation; see ResourceProvider::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    as_resource_provider

    fn as_resource_provider(self: &Self) -> Rc<dyn IResourceProvider>
    

    The provider as the resource provider interface.

    Source

    count

    fn count(self: &Self) -> usize
    

    The number of palettes.

    Source

    add

    fn add(self: &Self, key: ThemeVariant, value: Ref<ColorPaletteResources>)
    

    Adds the palette of a variant.

    Panics

    Panics if the variant already has a palette, or if it is neither the light nor the dark variant.

    Source

    try_add

    fn try_add(self: &Self, key: ThemeVariant, value: Ref<ColorPaletteResources>) -> Result<(), String>
    

    add for untyped callers (markup): the failures are errors. A variant that is not supported is rejected before the palette is added.

    Source

    clear

    fn clear(self: &Self)
    

    Removes all palettes.

    Source

    contains_key

    fn contains_key(self: &Self, key: &ThemeVariant) -> bool
    

    Whether the variant has a palette.

    Source

    remove

    fn remove(self: &Self, key: &ThemeVariant) -> bool
    

    Removes the palette of a variant; returns whether there was one.

    Source

    try_get_value

    fn try_get_value(self: &Self, key: &ThemeVariant) -> Option<Ref<ColorPaletteResources>>
    

    The palette of a variant.

    Source

    get

    fn get(self: &Self, key: &ThemeVariant) -> Ref<ColorPaletteResources>
    

    The palette of a variant.

    Panics

    Panics if the variant has no palette.

    Source

    set

    fn set(self: &Self, key: ThemeVariant, value: Ref<ColorPaletteResources>)
    

    Sets the palette of a variant, replacing the one it has.

    Source

    keys

    fn keys(self: &Self) -> Vec<ThemeVariant>
    

    The variants with a palette.

    Source

    values

    fn values(self: &Self) -> Vec<Ref<ColorPaletteResources>>
    

    The palettes.

    Source

    to_vec

    fn to_vec(self: &Self) -> Vec<(ThemeVariant, Ref<ColorPaletteResources>)>
    

    The palettes with their variants.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.