diff --git a/crates/coop/src/chatspace.rs b/crates/coop/src/chatspace.rs index 7c22cc3..0c8d039 100644 --- a/crates/coop/src/chatspace.rs +++ b/crates/coop/src/chatspace.rs @@ -129,6 +129,7 @@ impl ChatSpace { let center = DockItem::panel(panel); self.dock.update(cx, |this, cx| { + this.reset(window, cx); this.set_center(center, window, cx); }); } diff --git a/crates/ui/src/dock_area/mod.rs b/crates/ui/src/dock_area/mod.rs index b48b379..cc63a01 100644 --- a/crates/ui/src/dock_area/mod.rs +++ b/crates/ui/src/dock_area/mod.rs @@ -390,6 +390,14 @@ impl DockArea { self.update_toggle_button_tab_panels(window, cx); } + /// Reset all docks + pub fn reset(&mut self, _window: &mut Window, cx: &mut Context) { + self.left_dock = None; + self.right_dock = None; + self.bottom_dock = None; + cx.notify(); + } + /// Set locked state of the dock area, if locked, the dock area cannot be split or move, but allows to resize panels. pub fn set_locked(&mut self, locked: bool, _window: &mut Window, _cx: &mut App) { self.is_locked = locked;