pub enum Event {
Opened {
position: Option<Point>,
size: Size,
scale_factor: f32,
},
Closed,
Moved(Point),
Resized(Size),
Rescaled(f32),
RedrawRequested(Instant),
CloseRequested,
Focused,
Unfocused,
FileHovered(PathBuf),
FileDropped(PathBuf),
FilesHoveredLeft,
}Expand description
A window-related event.
Variants§
Opened
A window was opened.
Fields
position: Option<Point>The position of the opened window. This is relative to the top-left corner of the desktop the window is on, including virtual desktops. Refers to window’s “outer” position, or the window area, in logical pixels.
Note: Not available in Wayland.
Closed
A window was closed.
Moved(Point)
A window was moved.
Resized(Size)
A window was resized.
Rescaled(f32)
A window changed its scale factor.
RedrawRequested(Instant)
A window redraw was requested.
The Instant contains the current time.
CloseRequested
The user has requested for the window to close.
Focused
A window was focused.
Unfocused
A window was unfocused.
FileHovered(PathBuf)
A file is being hovered over the window.
When the user hovers multiple files at once, this event will be emitted for each file separately.
§Platform-specific
- Wayland: Not implemented.
FileDropped(PathBuf)
A file has been dropped into the window.
When the user drops multiple files at once, this event will be emitted for each file separately.
§Platform-specific
- Wayland: Not implemented.
FilesHoveredLeft
A file was hovered, but has exited the window.
There will be a single FilesHoveredLeft event triggered even if
multiple files were hovered.
§Platform-specific
- Wayland: Not implemented.