FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    StyleBase

    struct · ferroui-base · v0.5.0

    struct StyleBase
    

    Base class for Style, ControlTheme and ContainerQuery.

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

    Returns a strong reference to this object.

    Source

    set_parent

    fn set_parent(self: &Self, parent: Option<&Ref<StyleBase>>)
    

    Sets the parent style. Called when the style is added to or removed from the children of another style; validates that the style can be nested in parent.

    Source

    to_display_string

    fn to_display_string(self: &Self) -> String
    

    A string describing the style: its selector, target type or query.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see FerroObject::construct.

    Source

    children

    fn children(self: &Self) -> StyleChildren
    

    The children of the style.

    Source

    owner

    fn owner(self: &Self) -> Option<ResourceHostRef>
    

    The owner of the style: the resource host whose styles collection the style, or an ancestor of it, was added to.

    Source

    owner_changed

    fn owner_changed(self: &Self, handler: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
    

    Raised when the owner of the style changes.

    Source

    parent

    fn parent(self: &Self) -> Option<Ref<StyleBase>>
    

    The parent style, if the style is a nested style.

    Source

    resources

    fn resources(self: &Self) -> Ref<ResourceDictionary>
    

    The dictionary of style resources.

    Source

    set_resources

    fn set_resources(self: &Self, value: Ref<ResourceDictionary>)
    

    Source

    setters

    fn setters(self: &Self) -> FerroList<Rc<dyn SetterBase>>
    

    The style's setters. The list is returned by handle: clones refer to the same list.

    Source

    add_setter

    fn add_setter(self: &Self, setter: Rc<dyn SetterBase>)
    

    Adds a setter to the style.

    Source

    clear_setters

    fn clear_setters(self: &Self)
    

    Removes all setters from the style.

    Source

    add

    fn add(self: &Self, setter: Rc<dyn SetterBase>)
    

    Adds a setter to the style.

    Source

    animations

    fn animations(self: &Self) -> FerroList<Rc<dyn IAnimation>>
    

    The style's animations. The list is returned by handle: clones refer to the same list.

    Source

    add_animation

    fn add_animation(self: &Self, animation: impl Into<Rc<dyn IAnimation>>)
    

    Adds an animation to the style: it runs on every control the style applies to, while the style is active.

    Source

    clear_animations

    fn clear_animations(self: &Self)
    

    Removes all animations from the style.

    Source

    add_child

    fn add_child(self: &Self, child: &BoxedValue)
    

    Adds an untyped child: a setter is added to the setters, a style to the child styles. Panics for anything else.

    Source

    add_style

    fn add_style(self: &Self, style: impl Into<Rc<dyn IStyle>>)
    

    Adds a child style.

    Source

    try_get_resource

    fn try_get_resource(self: &Self, key: &ResourceKey, theme_variant: Option<&ThemeVariant>) -> Option<ResourceValue>
    

    Tries to find a resource in the style's resources and then in its child styles.

    Source

    add_owner

    fn add_owner(self: &Self, owner: &ResourceHostRef)
    

    Adds an owner to the style.

    Source

    remove_owner

    fn remove_owner(self: &Self, owner: &ResourceHostRef)
    

    Removes the owner of the style.

    Source

    Trait implementations

    Availability

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