From b5ab50b2a8a869d8d433d9e13878c1cf1d721414 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 15 Dec 2022 03:06:04 +0100 Subject: Implement `window::close` action and remove `should_exit` --- winit/src/window.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'winit/src/window.rs') 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() -> Command { + Command::single(command::Action::Window(window::Action::Close)) +} + /// Begins dragging the window while the left mouse button is held. pub fn drag() -> Command { Command::single(command::Action::Window(window::Action::Drag)) -- cgit