Struct zng::window::WindowChangedArgs
source · pub struct WindowChangedArgs {
pub timestamp: DInstant,
pub window_id: WindowId,
pub state: Option<(WindowState, WindowState)>,
pub position: Option<(Point2D<Px, Px>, Point2D<Dip, Dip>)>,
pub size: Option<Size2D<Dip, Dip>>,
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<(Point2D<Px, Px>, Point2D<Dip, Dip>)>
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<Size2D<Dip, Dip>>
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<(Point2D<Px, Px>, Point2D<Dip, Dip>)>>,
size: impl Into<Option<Size2D<Dip, Dip>>>,
cause: impl Into<EventCause>,
) -> WindowChangedArgs
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<(Point2D<Px, Px>, Point2D<Dip, Dip>)>>, size: impl Into<Option<Size2D<Dip, Dip>>>, cause: impl Into<EventCause>, ) -> WindowChangedArgs
New args from values that convert into the argument types.
sourcepub fn now(
window_id: impl Into<WindowId>,
state: impl Into<Option<(WindowState, WindowState)>>,
position: impl Into<Option<(Point2D<Px, Px>, Point2D<Dip, Dip>)>>,
size: impl Into<Option<Size2D<Dip, Dip>>>,
cause: impl Into<EventCause>,
) -> WindowChangedArgs
pub fn now( window_id: impl Into<WindowId>, state: impl Into<Option<(WindowState, WindowState)>>, position: impl Into<Option<(Point2D<Px, Px>, Point2D<Dip, Dip>)>>, size: impl Into<Option<Size2D<Dip, Dip>>>, cause: impl Into<EventCause>, ) -> WindowChangedArgs
Arguments for event that happened now (INSTANT.now
).
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§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