Struct zng_ext_window::WindowChangedArgs
source · pub struct WindowChangedArgs {
pub timestamp: DInstant,
pub window_id: WindowId,
pub state: Option<(WindowState, WindowState)>,
pub position: Option<(PxPoint, DipPoint)>,
pub size: Option<DipSize>,
pub cause: EventCause,
/* private fields */
}
Expand description
WINDOW_CHANGED_EVENT
args.
Fields§
§timestamp: DInstant
Instant the event happened.
window_id: WindowId
Window that has moved, resized or has a state change.
state: Option<(WindowState, WindowState)>
Window state change, if it has changed the values are (prev, new)
states.
position: Option<(PxPoint, DipPoint)>
New window position if it was moved.
The values are (global_position, actual_position)
where the global position is
in the virtual space that encompasses all monitors and actual position is in the monitor space.
size: Option<DipSize>
New window size if it was resized.
cause: EventCause
If the app or operating system caused the change.
Implementations§
source§impl WindowChangedArgs
impl WindowChangedArgs
sourcepub fn new(
timestamp: impl Into<DInstant>,
propagation_handle: EventPropagationHandle,
window_id: impl Into<WindowId>,
state: impl Into<Option<(WindowState, WindowState)>>,
position: impl Into<Option<(PxPoint, DipPoint)>>,
size: impl Into<Option<DipSize>>,
cause: impl Into<EventCause>,
) -> Self
pub fn new( timestamp: impl Into<DInstant>, propagation_handle: EventPropagationHandle, window_id: impl Into<WindowId>, state: impl Into<Option<(WindowState, WindowState)>>, position: impl Into<Option<(PxPoint, DipPoint)>>, size: impl Into<Option<DipSize>>, cause: impl Into<EventCause>, ) -> Self
New args from values that convert into the argument types.
source§impl WindowChangedArgs
impl WindowChangedArgs
sourcepub fn is_state_changed(&self) -> bool
pub fn is_state_changed(&self) -> bool
Returns true
if this event represents a window state change.
sourcepub fn prev_state(&self) -> Option<WindowState>
pub fn prev_state(&self) -> Option<WindowState>
Returns the previous window state if it has changed.
sourcepub fn new_state(&self) -> Option<WindowState>
pub fn new_state(&self) -> Option<WindowState>
Returns the new window state if it has changed.
sourcepub fn entered_state(&self, state: WindowState) -> bool
pub fn entered_state(&self, state: WindowState) -> bool
Returns true
if new_state
is state
and prev_state
is not.
sourcepub fn exited_state(&self, state: WindowState) -> bool
pub fn exited_state(&self, state: WindowState) -> bool
Returns true
if prev_state
is state
and new_state
is not.
sourcepub fn entered_fullscreen(&self) -> bool
pub fn entered_fullscreen(&self) -> bool
Returns true
if new_state
is one of the fullscreen states and prev_state
is not.
sourcepub fn exited_fullscreen(&self) -> bool
pub fn exited_fullscreen(&self) -> bool
Returns true
if prev_state
is one of the fullscreen states and new_state
is not.
sourcepub fn is_resized(&self) -> bool
pub fn is_resized(&self) -> bool
Returns true
if this event represents a window resize.
Trait Implementations§
source§impl AnyEventArgs for WindowChangedArgs
impl AnyEventArgs for WindowChangedArgs
source§fn delivery_list(&self, list: &mut UpdateDeliveryList)
fn delivery_list(&self, list: &mut UpdateDeliveryList)
Broadcast to all widgets.
source§fn clone_any(&self) -> Box<dyn AnyEventArgs>
fn clone_any(&self) -> Box<dyn AnyEventArgs>
source§fn propagation(&self) -> &EventPropagationHandle
fn propagation(&self) -> &EventPropagationHandle
source§impl Clone for WindowChangedArgs
impl Clone for WindowChangedArgs
source§fn clone(&self) -> WindowChangedArgs
fn clone(&self) -> WindowChangedArgs
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WindowChangedArgs
impl Debug for WindowChangedArgs
Auto Trait Implementations§
impl Freeze for WindowChangedArgs
impl RefUnwindSafe for WindowChangedArgs
impl Send for WindowChangedArgs
impl Sync for WindowChangedArgs
impl Unpin for WindowChangedArgs
impl UnwindSafe for WindowChangedArgs
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> 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<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> 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