pub enum WindowEvent {
Resized(PhysicalSize<u32>),
Moved(PhysicalPosition<i32>),
CloseRequested {
signal_tx: Sender<bool>,
},
Destroyed,
Focused(bool),
ScaleFactorChanged {
scale_factor: f64,
new_inner_size: PhysicalSize<u32>,
},
DragDrop(DragDropEvent),
ThemeChanged(Theme),
}
Expand description
An event from a window.
Variants§
Resized(PhysicalSize<u32>)
The size of the window has changed. Contains the client area’s new dimensions.
Moved(PhysicalPosition<i32>)
The position of the window has changed. Contains the window’s new position.
CloseRequested
The window has been requested to close.
Fields
Destroyed
The window has been destroyed.
Focused(bool)
The window gained or lost focus.
The parameter is true if the window has gained focus, and false if it has lost focus.
ScaleFactorChanged
The window’s scale factor has changed.
The following user actions can cause DPI changes:
- Changing the display’s resolution.
- Changing the display’s scale factor (e.g. in Control Panel on Windows).
- Moving the window to a display with a different scale factor.
Fields
§
new_inner_size: PhysicalSize<u32>
The window inner size.
DragDrop(DragDropEvent)
An event associated with the drag and drop action.
ThemeChanged(Theme)
The system window theme has changed.
Applications might wish to react to this to change the theme of the content of the window when the system changes the window theme.
Trait Implementations§
Source§impl Clone for WindowEvent
impl Clone for WindowEvent
Source§fn clone(&self) -> WindowEvent
fn clone(&self) -> WindowEvent
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for WindowEvent
impl RefUnwindSafe for WindowEvent
impl Send for WindowEvent
impl Sync for WindowEvent
impl Unpin for WindowEvent
impl UnwindSafe for WindowEvent
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)