#[non_exhaustive]pub struct WindowState {
pub mode: WindowMode,
pub minimized: bool,
pub visible: bool,
pub focused: bool,
pub bounds: Bounds<Points>,
pub content_bounds: Bounds<Points>,
pub placement: WindowPlacement,
pub display: Option<DisplayId>,
pub scale_factor: f32,
}Expand description
A window as the platform reports it (TS WindowRef.state() and
windowState(), Rust crate::element::desktop::WindowRef::state).
A move or a resize is reported once the window stops for a moment; a
change of mode, of display, of the focus or of being minimized or
hidden at once.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mode: WindowModeIts mode.
minimized: boolIt is minimized (in the Dock, the taskbar).
visible: boolIt is on the screen: shown and not minimized (the app not hidden by
macOS’s Hide). One there that lifecycle() reports in the
background is covered by other windows.
focused: boolIt has the keyboard focus.
bounds: Bounds<Points>Its outer frame now, window decorations included, in screen coordinates (a maximized or full screen window’s as it shows).
content_bounds: Bounds<Points>Its content area now, in screen coordinates.
placement: WindowPlacementIts mode and normal bounds: what to save to open it the same way next time.
display: Option<DisplayId>The display it is on (the one with most of it): one of
displays().
scale_factor: f32Device pixels per point.
Implementations§
Source§impl WindowState
impl WindowState
Sourcepub fn new(bounds: Bounds<Points>, placement: WindowPlacement) -> WindowState
pub fn new(bounds: Bounds<Points>, placement: WindowPlacement) -> WindowState
A window on the screen at bounds (its content too) in
placement’s mode, at a scale of 1.
Trait Implementations§
Source§impl Clone for WindowState
impl Clone for WindowState
impl Copy for WindowState
Source§impl Debug for WindowState
impl Debug for WindowState
Source§impl Default for WindowState
impl Default for WindowState
Source§impl JsValue for WindowState
impl JsValue for WindowState
Source§impl PartialEq for WindowState
impl PartialEq for WindowState
impl StructuralPartialEq for WindowState
Auto Trait Implementations§
impl Forget for WindowState
impl Freeze for WindowState
impl Move for WindowState
impl RefUnwindSafe for WindowState
impl Send for WindowState
impl Sync for WindowState
impl Unpin for WindowState
impl UnsafeUnpin for WindowState
impl UnwindSafe for WindowState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CallbackArgs for Twhere
T: Ret,
impl<T> CallbackArgs for Twhere
T: Ret,
Source§fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
names (name: string, amount: number), or without names value for one and a, b, … for
several.