#[non_exhaustive]pub enum WindowEvent {
Resized {
w: u32,
h: u32,
},
ScaleFactorChanged {
scale_factor: f32,
},
Focused {
focused: bool,
},
CloseRequested,
RedrawRequested,
}Expand description
Window-level lifecycle and surface events.
Possible notifications cover resize, scale factor, focus, close requests, and redraw requests.
§Examples
use ailloli_ui_core::event::WindowEvent;
let event = WindowEvent::Resized { w: 800, h: 600 };
assert!(matches!(event, WindowEvent::Resized { w: 800, h: 600 }));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Resized
Inner size changed (physical pixels).
Fields
ScaleFactorChanged
HiDPI scale factor changed.
Fields
Focused
Window gained or lost focus.
CloseRequested
User or chrome requested close.
RedrawRequested
Compositor or app requested a redraw.
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 moreSource§impl Debug for WindowEvent
impl Debug for WindowEvent
Source§impl PartialEq for WindowEvent
impl PartialEq for WindowEvent
impl StructuralPartialEq for WindowEvent
Auto 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