diff options
author | 2021-03-30 21:44:19 +0200 | |
---|---|---|
committer | 2021-03-30 21:44:19 +0200 | |
commit | 67db13ff7c727254182a8c4474bd962b205e2e99 (patch) | |
tree | f7dfba22c64ed4190521b2fde79c5dc5eecc4bed /winit/src/settings.rs | |
parent | 00de9d0c9ba20b313ffb459ed291ea2b85e53d32 (diff) | |
download | iced-67db13ff7c727254182a8c4474bd962b205e2e99.tar.gz iced-67db13ff7c727254182a8c4474bd962b205e2e99.tar.bz2 iced-67db13ff7c727254182a8c4474bd962b205e2e99.zip |
Add support for graceful exits in `Application`
- `Settings` now contains an `exit_on_close_request` field
- `Application` has a new `should_exit` method
Diffstat (limited to 'winit/src/settings.rs')
-rw-r--r-- | winit/src/settings.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/winit/src/settings.rs b/winit/src/settings.rs index 2e8715cd..9ce5cfc5 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -23,6 +23,10 @@ pub struct Settings<Flags> { /// /// [`Application`]: crate::Application pub flags: Flags, + + /// Whether the [`Application`] should exit when the user requests the + /// window to close (e.g. the user presses the close button). + pub exit_on_close_request: bool, } /// The window settings of an application. |