Add last window closed setting (#25185)
Release Notes: - Added an `on_last_window_closed` setting, that allows users to quit the app when the last window is closed --------- Co-authored-by: Richard <richard@zed.dev>
This commit is contained in:
parent
ffc7558a1d
commit
40425093df
8 changed files with 171 additions and 8 deletions
|
@ -1804,6 +1804,7 @@ impl Workspace {
|
|||
}
|
||||
|
||||
pub fn close_window(&mut self, _: &CloseWindow, window: &mut Window, cx: &mut Context<Self>) {
|
||||
println!("workspace::close_window");
|
||||
let prepare = self.prepare_to_close(CloseIntent::CloseWindow, window, cx);
|
||||
cx.spawn_in(window, |_, mut cx| async move {
|
||||
if prepare.await? {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue