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.
Members
TYPEto_refcreate_icon_element_coreget_icon_element_property_coreforeground_propertyconstructforegroundset_foregroundcreate_icon_element
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<IconSource>
Returns a strong reference to this object.
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.
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.
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.
construct
fn construct() -> Self
foreground
fn foreground(self: &Self) -> Option<Rc<dyn IBrush>>
set_foreground
fn set_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeIconSourceImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<IconSource>StaticTypeObjectTypeSubclassable<T>FerroObjectImplIconSourceImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.