Implement window::close action and remove should_exit

This commit is contained in:
Héctor Ramón Jiménez 2022-12-15 03:06:04 +01:00
parent 0591798db7
commit b5ab50b2a8
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
5 changed files with 21 additions and 15 deletions

View file

@ -4,6 +4,11 @@ use iced_native::window;
pub use window::{Event, Mode};
/// Closes the current window and exits the application.
pub fn close<Message>() -> Command<Message> {
Command::single(command::Action::Window(window::Action::Close))
}
/// Begins dragging the window while the left mouse button is held.
pub fn drag<Message>() -> Command<Message> {
Command::single(command::Action::Window(window::Action::Drag))