FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ThemeShadow

    struct · ferroui-base · v0.5.0

    struct ThemeShadow
    

    The shadow of the theme (WinUI Microsoft.UI.Xaml.Media.ThemeShadow): set as the Shadow of an element, the element casts the shadow of its elevation, the Z of its Translation, as the controls of WinUI do under their popups (32 for a flyout, 16 for a tool tip, 128 for a content dialog).

    WinUI 3 draws every theme shadow as a drop shadow (is_drop_shadow_mode): an ambient and a directional shadow around the element, the darker in the dark theme, none in a high contrast theme. A ThemeShadow can be shared by several elements; it has no appearance of its own.

    receivers are the elements the projected shadows of WinUI (the root and the open popups by default) would fall on. WinUI 3 keeps the collection and its validation but does not draw projected shadows, so the receivers do not change the drawing here either.

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

    Returns a strong reference to this object.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data.

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    is_drop_shadow_mode

    fn is_drop_shadow_mode() -> bool
    

    ThemeShadow.IsDropShadowMode: whether theme shadows are drawn as drop shadows around their casters (true in WinUI 3, whose projected shadows are disabled: CThemeShadow::IsDropShadowMode).

    Source

    receivers

    fn receivers(self: &Self) -> &UIElementWeakCollection
    

    ThemeShadow.Receivers: the elements the shadow is cast on in the projected mode. An ancestor of an element that casts the shadow cannot be a receiver.

    Source

    has_custom_receivers

    fn has_custom_receivers(self: &Self) -> bool
    

    Whether the receivers were set (WinUI's HasCustomReceivers): the projected mode casts the shadow on the root and the popups otherwise.

    Source

    mask

    fn mask(self: &Self) -> Option<Rc<CompositionBrush>>
    

    The mask of the shadow (internal in WinUI, set by the connected animations for the projected shadows).

    Source

    set_mask

    fn set_mask(self: &Self, value: Option<Rc<CompositionBrush>>)
    

    Source

    Trait implementations

    Availability

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