diff options
author | 2022-12-15 05:28:11 +0100 | |
---|---|---|
committer | 2022-12-15 05:28:11 +0100 | |
commit | d2d18479acd987b4a4f6a125c0dda7b2a6661df4 (patch) | |
tree | c93a370639111a76ce64a9b9489ccd430df812a6 /winit/src/window.rs | |
parent | e0c728c62c6fd9496de1d442e7476e24fc5e9023 (diff) | |
parent | b5ab50b2a8a869d8d433d9e13878c1cf1d721414 (diff) | |
download | iced-d2d18479acd987b4a4f6a125c0dda7b2a6661df4.tar.gz iced-d2d18479acd987b4a4f6a125c0dda7b2a6661df4.tar.bz2 iced-d2d18479acd987b4a4f6a125c0dda7b2a6661df4.zip |
Merge pull request #1606 from iced-rs/feature/window-close
Implement `window::close` action and remove `should_exit`
Diffstat (limited to '')
-rw-r--r-- | winit/src/window.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/winit/src/window.rs b/winit/src/window.rs index 1e704c5b..f6b43a0f 100644 --- a/winit/src/window.rs +++ b/winit/src/window.rs @@ -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)) |