Skip to content

Commit

Permalink
chore: add exit_on_close to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 authored and mmstick committed Oct 11, 2023
1 parent 14f2963 commit aa76a1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
4 changes: 4 additions & 0 deletions src/app/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
}
}
}

0 comments on commit aa76a1c

Please sign in to comment.