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

@ -449,8 +449,10 @@ impl<T: Application> Cosmic<T> {
}
Message::Close => {
self.app.on_app_exit();
return self.close();
return match self.app.on_app_exit() {
Some(message) => self.app.update(message),
None => self.close(),
};
}
Message::SystemThemeModeChange(keys, mode) => {
let mut cmds = vec![self.app.system_theme_mode_update(&keys, &mode)];