# ThemeShadowVisual

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/rendering/composition/struct-themeshadowvisual/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct ThemeShadowVisual
```

The shadow visual of a caster: created by the caster's
`Visual`, shown by its parent before the caster's own
visual.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/theme_shadow_visual.rs#L49)

## Members

- [`new`](#function-new)
- [`visual`](#function-visual)
- [`update`](#function-update)
- [`box_shadows`](#function-box_shadows)
- [`dispose`](#function-dispose)

<a id="function-new"></a>

### new

```rust
fn new(caster: &Rc<CompositionVisual>, recipe: &DropShadowRecipe) -> ThemeShadowVisual
```

Creates the shadow visual of `caster` (the composition visual of the
caster): its transform is taken in the space of the caster
(`ParentForTransform`), its opacity follows the caster's through an
expression (as `UpdateDropShadowVisualOpacity` does for an animated
opacity), and it is not hit-testable.

The handler starts with the shape of `recipe`, so that the first frame that shows the
visual draws the shadow (a message reaches the handler a frame later).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/theme_shadow_visual.rs#L65)

<a id="function-visual"></a>

### visual

```rust
fn visual(self: &Self) -> &Rc<CompositionVisual>
```

The composition visual.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/theme_shadow_visual.rs#L84)

<a id="function-update"></a>

### update

```rust
fn update(self: &Self, recipe: &DropShadowRecipe, size: Vector, visible: bool)
```

Shows `recipe` around a caster of `size`, or nothing when `visible` is
false or the recipe draws nothing.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/theme_shadow_visual.rs#L90)

<a id="function-box_shadows"></a>

### box_shadows

```rust
fn box_shadows(self: &Self) -> Vec<BoxShadow>
```

The box shadows the visual draws (for tests).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/theme_shadow_visual.rs#L106)

<a id="function-dispose"></a>

### dispose

```rust
fn dispose(self: &Self)
```

Releases the visual.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/theme_shadow_visual.rs#L111)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
