Introduce a new WindowContext::remove_window
API
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
f12746c4b7
commit
8c7f821d14
8 changed files with 25 additions and 29 deletions
|
@ -1741,8 +1741,6 @@ impl View for Pane {
|
|||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> Element<Self> {
|
||||
let this = cx.handle().downgrade();
|
||||
|
||||
enum MouseNavigationHandler {}
|
||||
|
||||
Stack::new()
|
||||
|
@ -1836,20 +1834,17 @@ impl View for Pane {
|
|||
.boxed()
|
||||
}
|
||||
})
|
||||
.on_down(MouseButton::Navigate(NavigationDirection::Back), {
|
||||
let this = this.clone();
|
||||
.on_down(
|
||||
MouseButton::Navigate(NavigationDirection::Back),
|
||||
move |_, _, cx| {
|
||||
cx.dispatch_action(GoBack {
|
||||
pane: Some(this.clone()),
|
||||
});
|
||||
}
|
||||
})
|
||||
let pane = cx.weak_handle();
|
||||
cx.dispatch_action(GoBack { pane: Some(pane) });
|
||||
},
|
||||
)
|
||||
.on_down(MouseButton::Navigate(NavigationDirection::Forward), {
|
||||
let this = this.clone();
|
||||
move |_, _, cx| {
|
||||
cx.dispatch_action(GoForward {
|
||||
pane: Some(this.clone()),
|
||||
})
|
||||
let pane = cx.weak_handle();
|
||||
cx.dispatch_action(GoForward { pane: Some(pane) })
|
||||
}
|
||||
})
|
||||
.boxed(),
|
||||
|
|
|
@ -74,8 +74,8 @@ where
|
|||
.boxed()
|
||||
})
|
||||
.on_up(MouseButton::Left, {
|
||||
let pane = cx.handle().downgrade();
|
||||
move |event, _, cx| {
|
||||
let pane = cx.weak_handle();
|
||||
handle_dropped_item(event, &pane, drop_index, allow_same_pane, split_margin, cx);
|
||||
cx.notify();
|
||||
}
|
||||
|
|
|
@ -700,8 +700,7 @@ impl Workspace {
|
|||
}
|
||||
|
||||
project::Event::Closed => {
|
||||
let window_id = cx.window_id();
|
||||
cx.remove_window(window_id);
|
||||
cx.remove_window();
|
||||
}
|
||||
|
||||
_ => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue