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:
parent
d53ccc857d
commit
83c7870c56
8 changed files with 130 additions and 85 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue