FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Brush

    struct · ferroui-base · v0.5.0

    struct Brush
    

    Describes how an area is painted. Abstract base class of the mutable brushes.

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

    Returns a strong reference to this object.

    Source

    on_referenced_from_compositor

    fn on_referenced_from_compositor(self: &Self, c: &Rc<Compositor>)
    

    Called when the brush got its counterpart on a compositor.

    Source

    on_unreferenced_from_compositor

    fn on_unreferenced_from_compositor(self: &Self, c: &Rc<Compositor>)
    

    Called when the brush lost its counterpart on a compositor.

    Source

    prepare_serialization

    fn prepare_serialization(self: &Self, c: &Rc<Compositor>)
    

    Creates the server objects the state of the brush refers to, before the state is written for its counterpart on a compositor (see ICompositorSerializable::prepare_serialization).

    Source

    opacity_property

    fn opacity_property() -> &'static StyledProperty<f64>
    

    Source

    transform_property

    fn transform_property() -> &'static StyledProperty<Option<Rc<dyn ITransform>>>
    

    Source

    transform_origin_property

    fn transform_origin_property() -> &'static StyledProperty<RelativePoint>
    

    Source

    relative_transform_property

    fn relative_transform_property() -> &'static StyledProperty<Option<Rc<dyn ITransform>>>
    

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see FerroObject::construct.

    Source

    opacity

    fn opacity(self: &Self) -> f64
    

    The opacity of the brush.

    Source

    set_opacity

    fn set_opacity(self: &Self, value: f64)
    

    Source

    transform

    fn transform(self: &Self) -> Option<Rc<dyn ITransform>>
    

    The transform of the brush.

    Source

    set_transform

    fn set_transform(self: &Self, value: Option<Rc<dyn ITransform>>)
    

    Source

    transform_origin

    fn transform_origin(self: &Self) -> RelativePoint
    

    The origin of the brush transform.

    Source

    set_transform_origin

    fn set_transform_origin(self: &Self, value: RelativePoint)
    

    Source

    relative_transform

    fn relative_transform(self: &Self) -> Option<Rc<dyn ITransform>>
    

    The transform of the brush, relative to the bounds of the painted area.

    Source

    set_relative_transform

    fn set_relative_transform(self: &Self, value: Option<Rc<dyn ITransform>>)
    

    Source

    parse

    fn parse(s: &str) -> Result<Rc<dyn IBrush>, FormatError>
    

    Parses a brush string: a known color name or any color format accepted by Color::parse.

    Source

    invalidated

    fn invalidated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Subscribes to invalidation of the brush: raised whenever a change requires the brush to be redrawn. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the brush.

    Source

    Trait implementations

    Availability

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