pub trait EffectExt: Sized {
// Required method
fn effect_mut(&mut self) -> &mut EffectData;
// Provided methods
fn cursor(self, cursor: impl Into<Option<CursorIcon>>) -> Self { ... }
fn cursor_visible(self, visible: impl Into<Option<bool>>) -> Self { ... }
fn effect(self, effect: EffectData) -> Self { ... }
fn overflow(self, overflow: impl Into<Overflow>) -> Self { ... }
fn backdrop_blur(self, blur: f32) -> Self { ... }
fn rotation(self, rotation: f32) -> Self { ... }
fn opacity(self, opacity: f32) -> Self { ... }
fn scale(self, scale: impl Into<Scale>) -> Self { ... }
fn transform_origin(
self,
transform_origin: impl Into<TransformOrigin>,
) -> Self { ... }
}Expand description
Methods for visual effects applied to an element: clipping, backdrop blur, rotation, opacity and scale.
Required Methods§
Sourcefn effect_mut(&mut self) -> &mut EffectData
fn effect_mut(&mut self) -> &mut EffectData
Returns a mutable reference to the element’s effect data.
Provided Methods§
Sourcefn cursor(self, cursor: impl Into<Option<CursorIcon>>) -> Self
fn cursor(self, cursor: impl Into<Option<CursorIcon>>) -> Self
Set the CursorIcon shown while the element is hovered.
When multiple hovered elements define a cursor, the one painted on top wins. While a mouse button is pressed the cursor stays still.
Sourcefn cursor_visible(self, visible: impl Into<Option<bool>>) -> Self
fn cursor_visible(self, visible: impl Into<Option<bool>>) -> Self
Show or hide the mouse cursor while the element is hovered.
The topmost hovered element with an explicit visibility wins, defaulting to visible.
Sourcefn effect(self, effect: EffectData) -> Self
fn effect(self, effect: EffectData) -> Self
Replace all of the element’s effect data at once. See EffectData.
Sourcefn overflow(self, overflow: impl Into<Overflow>) -> Self
fn overflow(self, overflow: impl Into<Overflow>) -> Self
Set whether content overflowing the element’s bounds is clipped. See Overflow.
Sourcefn backdrop_blur(self, blur: f32) -> Self
fn backdrop_blur(self, blur: f32) -> Self
Apply a Gaussian blur of the given radius to the backdrop behind the element.
Sourcefn opacity(self, opacity: f32) -> Self
fn opacity(self, opacity: f32) -> Self
Set the element’s opacity, from 0.0 (transparent) to 1.0 (opaque).
Sourcefn transform_origin(self, transform_origin: impl Into<TransformOrigin>) -> Self
fn transform_origin(self, transform_origin: impl Into<TransformOrigin>) -> Self
Set the point that the scale and rotation effects pivot around.
Defaults to the element’s center.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".