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.
Members
TYPEto_refhideshowon_resizedarrange_set_boundsis_visible_changedis_active_propertyowner_propertytopmost_propertyignore_visibility_changesfreeze_visibility_change_handlingactivateddeactivatedposition_changedresizedis_activescreensownerset_ownertopmostset_topmostdesktop_scalingdesktop_scaling_overrideset_desktop_scaling_overrideactivateensure_initialized
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<WindowBase>
Returns a strong reference to this object.
hide
fn hide(self: &Self)
Hides the window.
show
fn show(self: &Self)
Shows the window.
on_resized
fn on_resized(self: &Self, e: &WindowResizedEventArgs)
Raises the Resized event.
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.
is_visible_changed
fn is_visible_changed(self: &Self, e: &FerroPropertyChangedEventArgs<'_>)
Called when the IsVisible property changes.
is_active_property
fn is_active_property() -> &'static DirectProperty<WindowBase, bool>
Defines the IsActive property.
owner_property
fn owner_property() -> &'static DirectProperty<WindowBase, Option<Ref<WindowBase>>>
Defines the Owner property.
topmost_property
fn topmost_property() -> &'static StyledProperty<bool>
Defines the Topmost property.
ignore_visibility_changes
fn ignore_visibility_changes(self: &Self) -> bool
Whether visibility changes are currently ignored (protected upstream).
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).
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.
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.
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.
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.
is_active
fn is_active(self: &Self) -> bool
Whether the window is active.
screens
fn screens(self: &Self) -> Rc<Screens>
The screens of the platform.
Panics
Panics when the windowing backend does not provide screens.
owner
fn owner(self: &Self) -> Option<Ref<WindowBase>>
The owner of the window.
set_owner
fn set_owner(self: &Self, value: Option<Ref<WindowBase>>)
Sets the owner of the window (protected upstream: for derived classes).
topmost
fn topmost(self: &Self) -> bool
Whether this window appears on top of all other windows.
set_topmost
fn set_topmost(self: &Self, value: bool)
desktop_scaling
fn desktop_scaling(self: &Self) -> f64
The scaling factor for window positioning and sizing.
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).
set_desktop_scaling_override
fn set_desktop_scaling_override(self: &Self, value: Option<f64>)
activate
fn activate(self: &Self)
Activates the window.
ensure_initialized
fn ensure_initialized(self: &Self)
Ensures that the window is initialized (protected upstream: for derived classes).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtContentControlImplExtControlImplExtTopLevelImplExtWindowBaseImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<WindowBase>StaticTypeObjectTypeSubclassable<T>StyledElementImplVisualImplInteractiveImplInputElementImplControlImplTemplatedControlImplContentControlImplFerroObjectImplLayoutableImplTopLevelImplWindowBaseImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.