Merge pull request #2243 from zed-industries/joseph/z-225-track-open-terminals

Keep track of open terminals
This commit is contained in:
Joseph T. Lyons 2023-03-03 12:55:28 -08:00 committed by GitHub
commit b9573872e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 76 additions and 30 deletions

View file

@ -11,9 +11,10 @@ pub struct TerminalButton {
workspace: WeakViewHandle<Workspace>,
}
// TODO: Rename this to `DeployTerminalButton`
impl TerminalButton {
pub fn new(workspace: ViewHandle<Workspace>, cx: &mut ViewContext<Self>) -> Self {
// When dock moves, redraw so that the icon and toggle status matches.
// When terminal moves, redraw so that the icon and toggle status matches.
cx.subscribe(&workspace, |_, _, _, cx| cx.notify()).detach();
Self {
@ -63,6 +64,7 @@ impl View for TerminalButton {
})
.with_cursor_style(CursorStyle::PointingHand)
.on_up(MouseButton::Left, move |_, _| {
// TODO: Do we need this stuff?
// let dock_pane = workspace.read(cx.app).dock_pane();
// let drop_index = dock_pane.read(cx.app).items_len() + 1;
// handle_dropped_item(event, &dock_pane.downgrade(), drop_index, false, None, cx);