FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IconSource

    struct · ferroui-controls · v0.5.0

    struct IconSource
    

    The base class of the descriptions of an icon that can be shared (WinUI's IconSource): each create_icon_element creates a new icon element, and a later change of a property of the source is set on every element it created that is still alive.

    The source holds its elements weakly and does not subscribe to them, so neither keeps the other alive. This class is abstract: it creates no element (create_icon_element is None, as WinUI's base returns no element); the derived sources create theirs.

    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<IconSource>
    

    Returns a strong reference to this object.

    Source

    create_icon_element_core

    fn create_icon_element_core(self: &Self) -> Option<Ref<IconElement>>
    

    Creates the icon element of the source with the values of its properties (CreateIconElementCore); None for the abstract base.

    Source

    get_icon_element_property_core

    fn get_icon_element_property_core(self: &Self, property: &'static FerroProperty) -> Option<&'static FerroProperty>
    

    The property of the icon elements that a property of the source is set on (GetIconElementPropertyCore); None for a property that is not.

    Source

    foreground_property

    fn foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the Foreground property: the foreground of the icons. Unset (None, the default), an icon keeps the foreground it inherits.

    Source

    construct

    fn construct() -> Self
    

    Source

    foreground

    fn foreground(self: &Self) -> Option<Rc<dyn IBrush>>
    

    Source

    set_foreground

    fn set_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    create_icon_element

    fn create_icon_element(self: &Self) -> Option<Ref<IconElement>>
    

    Creates an icon element with the values of the source (IconSource::CreateIconElement): the foreground only when the source has one, so that an icon without inherits its foreground. None for a source that creates no element.

    Source

    Trait implementations

    Availability

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