chore: add exit_on_close to settings

This commit is contained in:
Ashley Wulber 2023-10-09 10:30:10 -04:00 committed by Michael Murphy
parent 14f29631ad
commit aa76a1c820
2 changed files with 5 additions and 0 deletions

View file

@ -72,6 +72,7 @@ pub fn run<App: Application>(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")]

View file

@ -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,
}
}
}