Add support for graceful exits in Application

- `Settings` now contains an `exit_on_close_request` field
- `Application` has a new `should_exit` method
This commit is contained in:
Héctor Ramón Jiménez 2021-03-30 21:44:19 +02:00
parent 00de9d0c9b
commit 67db13ff7c
5 changed files with 57 additions and 9 deletions

View file

@ -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.