feat: allow on_app_exit to override closing the application

This commit is contained in:
Jeremy Soller 2024-05-13 09:33:47 -06:00 committed by Michael Murphy
parent cac3d0b5df
commit ac95b571ec
2 changed files with 8 additions and 4 deletions

View file

@ -494,8 +494,10 @@ where
None
}
/// Called before closing the application.
fn on_app_exit(&mut self) {}
/// Called before closing the application. Returning a message will override closing windows.
fn on_app_exit(&mut self) -> Option<Self::Message> {
None
}
/// Called when a window requests to be closed.
fn on_close_requested(&self, id: window::Id) -> Option<Self::Message> {