#[non_exhaustive]pub struct WindowStateAll {
pub state: WindowState,
pub global_position: PxPoint,
pub restore_rect: DipRect,
pub restore_state: WindowState,
pub min_size: DipSize,
pub max_size: DipSize,
pub chrome_visible: bool,
}Expand description
Represents the properties of a window that affect its position, size and state.
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.state: WindowStateThe window state.
global_position: PxPointPosition across monitors.
This is mostly used to find a monitor to resolve the restore_rect in.
restore_rect: DipRectPosition and size of the window in the Normal state.
The position is relative to the monitor.
restore_state: WindowStateWhat state the window goes too when “restored”.
The restore state that the window must be set to be restored, if the current state is Maximized, Fullscreen or Exclusive
the restore state is Normal, if the current state is Minimized the restore state is the previous state.
When the restore state is Normal the restore_rect defines the window position and size.
min_size: DipSizeMinimal Normal size allowed.
max_size: DipSizeMaximum Normal size allowed.
chrome_visible: boolIf the system provided outer-border and title-bar is visible.
This is also called the “decoration” or “chrome” of the window. Note that the system may prefer
Implementations§
Source§impl WindowStateAll
impl WindowStateAll
Sourcepub fn new(
state: WindowState,
global_position: PxPoint,
restore_rect: DipRect,
restore_state: WindowState,
min_size: DipSize,
max_size: DipSize,
chrome_visible: bool,
) -> Self
pub fn new( state: WindowState, global_position: PxPoint, restore_rect: DipRect, restore_state: WindowState, min_size: DipSize, max_size: DipSize, chrome_visible: bool, ) -> Self
New state.
Sourcepub fn clamp_size(&mut self)
pub fn clamp_size(&mut self)
Clamp the restore_rect.size to min_size and max_size.
Sourcepub fn set_state(&mut self, new_state: WindowState)
pub fn set_state(&mut self, new_state: WindowState)
Compute a value for restore_state given the previous state in self and the new_state and update the state.
Sourcepub fn set_restore_state_from(&mut self, prev_state: WindowState)
pub fn set_restore_state_from(&mut self, prev_state: WindowState)
Compute a value for restore_state given the previous prev_state and the new state in self.
Trait Implementations§
Source§impl Clone for WindowStateAll
impl Clone for WindowStateAll
Source§fn clone(&self) -> WindowStateAll
fn clone(&self) -> WindowStateAll
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowStateAll
impl Debug for WindowStateAll
Source§impl<'de> Deserialize<'de> for WindowStateAll
impl<'de> Deserialize<'de> for WindowStateAll
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for WindowStateAll
impl PartialEq for WindowStateAll
Source§impl Serialize for WindowStateAll
impl Serialize for WindowStateAll
impl Eq for WindowStateAll
impl StructuralPartialEq for WindowStateAll
Auto Trait Implementations§
impl Freeze for WindowStateAll
impl RefUnwindSafe for WindowStateAll
impl Send for WindowStateAll
impl Sync for WindowStateAll
impl Unpin for WindowStateAll
impl UnwindSafe for WindowStateAll
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more