pub struct WindowState {Show 48 fields
pub handle: WindowHandle,
pub display_id: Option<DisplayId>,
pub kind: WindowKind,
pub bounds: WindowBounds,
pub viewport_size: Size,
pub minimum_size: Option<Size>,
pub maximum_size: Option<Size>,
pub scale_factor: f32,
pub appearance: WindowAppearance,
pub background_appearance: WindowBackgroundAppearance,
pub macos_vibrancy: Option<MacOsVibrancy>,
pub macos_visual_effect_state: MacOsVisualEffectState,
pub focused: bool,
pub focusable: bool,
pub visible: bool,
pub minimized: bool,
pub maximized: bool,
pub fullscreen: bool,
pub occluded: bool,
pub movable: bool,
pub resizable: bool,
pub minimizable: bool,
pub maximizable: bool,
pub closable: bool,
pub decorated: bool,
pub shadow: bool,
pub content_protected: bool,
pub window_level: WindowLevel,
pub ignore_mouse_events: bool,
pub forward_mouse_events: bool,
pub window_enabled: bool,
pub aspect_ratio: Option<Size>,
pub window_buttons_visible: bool,
pub skip_taskbar: bool,
pub visible_on_all_workspaces: bool,
pub opacity: f32,
pub has_icon: bool,
pub taskbar_progress_state: TaskbarProgressState,
pub taskbar_progress: f32,
pub has_taskbar_overlay_icon: bool,
pub cursor_visible: bool,
pub cursor_grab: CursorGrabMode,
pub cursor_hit_test: bool,
pub cursor_position: Option<Point>,
pub represented_file: bool,
pub document_edited: bool,
pub native_tabbing: bool,
pub native_tabs: WindowTabState,
}Expand description
Retained native state available during declarative rendering.
Fields§
§handle: WindowHandle§display_id: Option<DisplayId>Display currently containing the native window, when known.
kind: WindowKind§bounds: WindowBounds§viewport_size: Size§minimum_size: Option<Size>Effective native minimum inner size, or None when unconstrained.
maximum_size: Option<Size>Effective native maximum inner size, or None when unconstrained.
scale_factor: f32§appearance: WindowAppearance§background_appearance: WindowBackgroundAppearance§macos_vibrancy: Option<MacOsVibrancy>Active macOS semantic vibrancy material, when requested.
macos_visual_effect_state: MacOsVisualEffectState§focused: bool§focusable: boolWhether the native window is permitted to receive keyboard focus.
visible: bool§minimized: bool§maximized: bool§fullscreen: bool§occluded: bool§movable: bool§resizable: bool§minimizable: bool§maximizable: bool§closable: bool§decorated: bool§shadow: bool§content_protected: bool§window_level: WindowLevel§ignore_mouse_events: boolWhether native pointer events pass through this window to whatever is behind it.
forward_mouse_events: boolWhether pointer motion is still delivered to this window while clicks pass through.
window_enabled: boolWhether the native window currently accepts any input at all.
aspect_ratio: Option<Size>Retained content aspect ratio as width:height, or None when unconstrained.
Whether the macOS close/minimize/zoom buttons are visible.
skip_taskbar: boolWhether this window is omitted from the taskbar on supported platforms.
visible_on_all_workspaces: boolWhether this window follows the user across virtual desktops/spaces.
opacity: f32Whole-window native alpha in the inclusive 0.0..=1.0 range.
has_icon: boolWhether an explicit native window icon is installed.
taskbar_progress_state: TaskbarProgressStateRetained taskbar progress mode and bounded completion value.
taskbar_progress: f32§has_taskbar_overlay_icon: boolWhether a Windows taskbar overlay icon is installed.
cursor_visible: bool§cursor_grab: CursorGrabMode§cursor_hit_test: boolWhether the native window participates in pointer hit testing.
cursor_position: Option<Point>Last known pointer position in logical window coordinates.
represented_file: boolWhether the native titlebar currently represents a document file.
document_edited: boolWhether native chrome indicates that the represented document has unsaved changes.
native_tabbing: boolWhether this window opted into native system tabbing.
native_tabs: WindowTabStateBounded cached state for the native AppKit tab group.
Implementations§
Source§impl WindowState
impl WindowState
Sourcepub fn restore_state(&self, displays: &Displays) -> WindowRestoreState
pub fn restore_state(&self, displays: &Displays) -> WindowRestoreState
Capture persistable geometry and display identity for this window.
The rectangle is the windowed restore geometry, so a maximized or fullscreen window still
persists the size it returns to. Pass the result to
WindowOptions::restore on the next launch.
Trait Implementations§
Source§impl Clone for WindowState
impl Clone for WindowState
Source§fn clone(&self) -> WindowState
fn clone(&self) -> WindowState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WindowState
Source§impl Debug for WindowState
impl Debug for WindowState
Source§impl PartialEq for WindowState
impl PartialEq for WindowState
impl StructuralPartialEq for WindowState
Auto Trait Implementations§
impl Freeze 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§
impl<T> Action for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.