Add CloseRequested
variant to window::Event
This commit is contained in:
parent
bbb4e4678f
commit
00de9d0c9b
@ -12,6 +12,12 @@ pub enum Event {
|
|||||||
height: u32,
|
height: u32,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/// The user has requested for the window to close.
|
||||||
|
///
|
||||||
|
/// Usually, you will want to terminate the execution whenever this event
|
||||||
|
/// occurs.
|
||||||
|
CloseRequested,
|
||||||
|
|
||||||
/// A window was focused.
|
/// A window was focused.
|
||||||
Focused,
|
Focused,
|
||||||
|
|
||||||
|
@ -33,6 +33,9 @@ pub fn window_event(
|
|||||||
height: logical_size.height,
|
height: logical_size.height,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
WindowEvent::CloseRequested => {
|
||||||
|
Some(Event::Window(window::Event::CloseRequested))
|
||||||
|
}
|
||||||
WindowEvent::CursorMoved { position, .. } => {
|
WindowEvent::CursorMoved { position, .. } => {
|
||||||
let position = position.to_logical::<f64>(scale_factor);
|
let position = position.to_logical::<f64>(scale_factor);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user