feat: allow on_app_exit to override closing the application
This commit is contained in:
parent
cac3d0b5df
commit
ac95b571ec
2 changed files with 8 additions and 4 deletions
|
|
@ -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)];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue