MaterialRipple
struct · ferroui-themes-material · v0.5.0
struct MaterialRipple
A bounded Material ink ripple. Place it inside the root of a control template, above the background/state layer and below the content. It observes the templated parent's input, so it neither intercepts hit testing nor changes the control's click, capture or focus behavior.
Hover and focus state layers remain the template's responsibility. A separate pressed state layer must not be painted on top of this ripple: its default peak opacity is already 0.10.
<material:MaterialRipple Fill="{TemplateBinding Foreground}"
CornerRadius="{TemplateBinding CornerRadius}"
ReducedMotion="{DynamicResource MaterialReducedMotion}" />
Each touch contact has an independent wave; quick taps finish expanding before fading out. Frame callbacks and input subscriptions use weak references and are canceled on detachment.
Members
TYPEto_reffill_propertycorner_radius_propertyis_bounded_propertyradius_propertyinteraction_opacity_propertyreduced_motion_propertyconstructnewfillset_fillcorner_radiusset_corner_radiusis_boundedset_is_boundedradiusset_radiusinteraction_opacityset_interaction_opacityreduced_motionset_reduced_motionbegin_pressend_pressactive_ripple_countcancel
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<MaterialRipple>
Returns a strong reference to this object.
fill_property
fn fill_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
The ripple color, normally the surrounding component's content color.
corner_radius_property
fn corner_radius_property() -> &'static StyledProperty<CornerRadius>
The clipping corners; bind to the animated surface corners for shape-changing buttons.
is_bounded_property
fn is_bounded_property() -> &'static StyledProperty<bool>
Whether the ripple is clipped to the rounded layout bounds.
radius_property
fn radius_property() -> &'static StyledProperty<f64>
An explicit final radius. NaN computes the radius from the control's bounds.
interaction_opacity_property
fn interaction_opacity_property() -> &'static StyledProperty<f64>
The Material pressed-state opacity, multiplied by the brush's own alpha.
reduced_motion_property
fn reduced_motion_property() -> &'static StyledProperty<bool>
Replaces radial motion by a steady pressed indication. Also honors platform settings.
construct
fn construct() -> Self
new
fn new() -> Ref<Self>
fill
fn fill(self: &Self) -> Option<Rc<dyn IBrush>>
set_fill
fn set_fill(self: &Self, value: Option<Rc<dyn IBrush>>)
corner_radius
fn corner_radius(self: &Self) -> CornerRadius
set_corner_radius
fn set_corner_radius(self: &Self, value: CornerRadius)
is_bounded
fn is_bounded(self: &Self) -> bool
set_is_bounded
fn set_is_bounded(self: &Self, value: bool)
radius
fn radius(self: &Self) -> f64
set_radius
fn set_radius(self: &Self, value: f64)
interaction_opacity
fn interaction_opacity(self: &Self) -> f64
set_interaction_opacity
fn set_interaction_opacity(self: &Self, value: f64)
reduced_motion
fn reduced_motion(self: &Self) -> bool
set_reduced_motion
fn set_reduced_motion(self: &Self, value: bool)
begin_press
fn begin_press(self: &Self, origin: Point)
Starts a programmatic indication. The location is in this control's coordinate space. Template instances receive their input automatically and do not need this method.
end_press
fn end_press(self: &Self)
Finishes the corresponding programmatic indication.
active_ripple_count
fn active_ripple_count(self: &Self) -> usize
The number of held or fading press indications, useful to inspect control behavior.
cancel
fn cancel(self: &Self)
Clears every indication, for example when a control becomes disabled.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherCastableFrom<ST, Uninit, Uninit>CastableFrom<ST, Initialized, Initialized>Read<Exclusive, BecauseExclusive>ControlImplExtDerefUpcast<T>Upcast<MaterialRipple>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplLayoutableImplInteractiveImplInputElementImplControlImplFerroObjectImplVisualImplDrop
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.