FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    WindowBase

    struct · ferroui-controls · v0.5.0

    struct WindowBase
    

    Base class for top-level windows.

    This class acts as a base for top level windows such as Window and PopupRoot. It handles scheduling layout, styling and rendering as well as tracking the window client size and window activation.

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

    Returns a strong reference to this object.

    Source

    hide

    fn hide(self: &Self)
    

    Hides the window.

    Source

    show

    fn show(self: &Self)
    

    Shows the window.

    Source

    on_resized

    fn on_resized(self: &Self, e: &WindowResizedEventArgs)
    

    Raises the Resized event.

    Source

    arrange_set_bounds

    fn arrange_set_bounds(self: &Self, size: Size) -> Size
    

    Called during the arrange pass to set the size of the window; returns the size to arrange the content with.

    Source

    is_visible_changed

    fn is_visible_changed(self: &Self, e: &FerroPropertyChangedEventArgs<'_>)
    

    Called when the IsVisible property changes.

    Source

    is_active_property

    fn is_active_property() -> &'static DirectProperty<WindowBase, bool>
    

    Defines the IsActive property.

    Source

    owner_property

    fn owner_property() -> &'static DirectProperty<WindowBase, Option<Ref<WindowBase>>>
    

    Defines the Owner property.

    Source

    topmost_property

    fn topmost_property() -> &'static StyledProperty<bool>
    

    Defines the Topmost property.

    Source

    ignore_visibility_changes

    fn ignore_visibility_changes(self: &Self) -> bool
    

    Whether visibility changes are currently ignored (protected upstream).

    Source

    freeze_visibility_change_handling

    fn freeze_visibility_change_handling(self: &Self) -> IgnoreVisibilityChangesGuard
    

    Ignores visibility changes until the returned guard is dropped (private protected upstream: for derived classes).

    Source

    activated

    fn activated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Fired when the window is activated.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the window.

    Source

    deactivated

    fn deactivated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Fired when the window is deactivated.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the window.

    Source

    position_changed

    fn position_changed(self: &Self, handler: impl Fn(&PixelPointEventArgs) -> () + 'static) -> Subscription
    

    Fired when the window position is changed.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the window.

    Source

    resized

    fn resized(self: &Self, handler: impl Fn(&WindowResizedEventArgs) -> () + 'static) -> Subscription
    

    Fired when the window is resized.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the window.

    Source

    is_active

    fn is_active(self: &Self) -> bool
    

    Whether the window is active.

    Source

    screens

    fn screens(self: &Self) -> Rc<Screens>
    

    The screens of the platform.

    Panics

    Panics when the windowing backend does not provide screens.

    Source

    owner

    fn owner(self: &Self) -> Option<Ref<WindowBase>>
    

    The owner of the window.

    Source

    set_owner

    fn set_owner(self: &Self, value: Option<Ref<WindowBase>>)
    

    Sets the owner of the window (protected upstream: for derived classes).

    Source

    topmost

    fn topmost(self: &Self) -> bool
    

    Whether this window appears on top of all other windows.

    Source

    set_topmost

    fn set_topmost(self: &Self, value: bool)
    

    Source

    desktop_scaling

    fn desktop_scaling(self: &Self) -> f64
    

    The scaling factor for window positioning and sizing.

    Source

    desktop_scaling_override

    fn desktop_scaling_override(self: &Self) -> Option<f64>
    

    The desktop scaling used instead of the platform's (private protected upstream: for derived classes).

    Source

    set_desktop_scaling_override

    fn set_desktop_scaling_override(self: &Self, value: Option<f64>)
    

    Source

    activate

    fn activate(self: &Self)
    

    Activates the window.

    Source

    ensure_initialized

    fn ensure_initialized(self: &Self)
    

    Ensures that the window is initialized (protected upstream: for derived classes).

    Source

    Trait implementations

    Availability

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