Moved exit_on_close_request to window settings. This now controls whether each INDIVIDUAL window should close on CloseRequested events.

This commit is contained in:
Bingus 2023-07-24 14:32:59 -07:00
parent d53ccc857d
commit 83c7870c56
No known key found for this signature in database
GPG key ID: 5F84D2AA40A9F170
8 changed files with 130 additions and 85 deletions

View file

@ -41,14 +41,6 @@ pub struct Settings<Flags> {
///
/// [`Canvas`]: crate::widget::Canvas
pub antialiasing: bool,
/// Whether the [`Application`] should exit when the user requests the
/// window to close (e.g. the user presses the close button).
///
/// By default, it is enabled.
///
/// [`Application`]: crate::Application
pub exit_on_close_request: bool,
}
impl<Flags> Settings<Flags> {
@ -65,7 +57,6 @@ impl<Flags> Settings<Flags> {
default_font: default_settings.default_font,
default_text_size: default_settings.default_text_size,
antialiasing: default_settings.antialiasing,
exit_on_close_request: default_settings.exit_on_close_request,
}
}
}
@ -82,7 +73,6 @@ where
default_font: Default::default(),
default_text_size: 16.0,
antialiasing: false,
exit_on_close_request: true,
}
}
}
@ -93,7 +83,6 @@ impl<Flags> From<Settings<Flags>> for iced_winit::Settings<Flags> {
id: settings.id,
window: settings.window,
flags: settings.flags,
exit_on_close_request: settings.exit_on_close_request,
}
}
}