Skip to main content

EffectExt

Trait EffectExt 

Source
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§

Source

fn effect_mut(&mut self) -> &mut EffectData

Returns a mutable reference to the element’s effect data.

Provided Methods§

Source

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.

Source

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.

Source

fn effect(self, effect: EffectData) -> Self

Replace all of the element’s effect data at once. See EffectData.

Source

fn overflow(self, overflow: impl Into<Overflow>) -> Self

Set whether content overflowing the element’s bounds is clipped. See Overflow.

Source

fn backdrop_blur(self, blur: f32) -> Self

Apply a Gaussian blur of the given radius to the backdrop behind the element.

Source

fn rotation(self, rotation: f32) -> Self

Rotate the element by the given angle in degrees.

Source

fn opacity(self, opacity: f32) -> Self

Set the element’s opacity, from 0.0 (transparent) to 1.0 (opaque).

Source

fn scale(self, scale: impl Into<Scale>) -> Self

Scale the element. See Scale.

Source

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".

Implementors§