From aa76a1c820f7d078a2c27170e7e33176a5fc2aff Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 9 Oct 2023 10:30:10 -0400 Subject: [PATCH] chore: add exit_on_close to settings --- src/app/mod.rs | 1 + src/app/settings.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/app/mod.rs b/src/app/mod.rs index 070e909d..852d6978 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -72,6 +72,7 @@ pub fn run(settings: Settings, flags: App::Flags) -> iced::Res iced.antialiasing = settings.antialiasing; iced.default_font = settings.default_font; iced.default_text_size = settings.default_text_size; + iced.exit_on_close_request = settings.exit_on_close; iced.id = Some(App::APP_ID.to_owned()); #[cfg(feature = "wayland")] diff --git a/src/app/settings.rs b/src/app/settings.rs index 3adecc83..10ed4dd3 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -59,6 +59,9 @@ pub struct Settings { /// Whether the window should be transparent. pub(crate) transparent: bool, + + /// Whether the application should exit when there are no open windows + pub(crate) exit_on_close: bool, } impl Settings { @@ -93,6 +96,7 @@ impl Default for Settings { size_limits: Limits::NONE.min_height(1.0).min_width(1.0), theme: crate::theme::system_preference(), transparent: false, + exit_on_close: true, } } }