Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Make active panel's button close its dock
Max Brunsfeld76927b6d95bb
diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rsindex 886afe943d0..ac52c8f1790 100644--- a/crates/workspace/src/dock.rs+++ b/crates/workspace/src/dock.rs@@ -472,11 +472,22 @@ impl View for PanelButtons {Flex::row().with_children(panels.into_iter().enumerate().map(|(panel_ix, (view, context_menu))| {- let (tooltip, tooltip_action) = view.icon_tooltip(cx);+ let is_active = is_open && panel_ix == active_ix;+ let (tooltip, tooltip_action) = if is_active {+ (+ format!("Close {} dock", dock_position.to_label()),+ Some(match dock_position {+ DockPosition::Left => crate::ToggleLeftDock.boxed_clone(),+ DockPosition::Bottom => crate::ToggleBottomDock.boxed_clone(),+ DockPosition::Right => crate::ToggleRightDock.boxed_clone(),+ }),+ )+ } else {+ view.icon_tooltip(cx)+ };Stack::new().with_child(MouseEventHandler::<Self, _>::new(panel_ix, cx, |state, cx| {- let is_active = is_open && panel_ix == active_ix;let style = button_style.style_for(state, is_active);Flex::row().with_child(