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),
Suspended,
Resumed,
}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.
Suspended
mobile only.Emitted when the application has been suspended.
§Platform-specific
- Android: This is triggered by
onPausemethod of the Activity. - iOS: This is triggered by
applicationWillResignActivemethod of the UIApplicationDelegate. - Linux / macOS / Windows: Unsupported.
Resumed
mobile only.Emitted when the application has been resumed.
§Platform-specific
- Android: This is triggered by
onResumemethod of the Activity. The first onResume() is ignored to match the iOS implementation, since that is called on activity creation. - iOS: This is triggered by
applicationWillEnterForegroundmethod of the UIApplicationDelegate. - Linux / macOS / Windows: Unsupported.
Trait Implementations§
Source§impl Clone for WindowEvent
impl Clone for WindowEvent
Source§fn clone(&self) -> WindowEvent
fn clone(&self) -> WindowEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more