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§
§state: WindowState
The window state.
global_position: PxPoint
Position across monitors.
This is mostly used to find a monitor to resolve the restore_rect
in.
restore_rect: DipRect
Position and size of the window in the Normal
state.
The position is relative to the monitor.
restore_state: WindowState
What 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: DipSize
Minimal Normal
size allowed.
max_size: DipSize
Maximum Normal
size allowed.
chrome_visible: bool
If 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 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 Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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