update dock

This commit is contained in:
2026-08-19 10:13:29 +07:00
parent 071cb9e714
commit c8bf7eb5d3
11 changed files with 236 additions and 2228 deletions
+2 -34
View File
@@ -6,8 +6,8 @@ use gpui::{
Window,
};
use gpui_component::{
ActiveTheme, AxisExt as _, Placement, ResizablePanelEvent, ResizablePanelGroup, ResizableState,
h_flex, resizable_panel,
ActiveTheme, Placement, ResizablePanelEvent, ResizablePanelGroup, ResizableState, h_flex,
resizable_panel,
};
use smallvec::SmallVec;
@@ -354,38 +354,6 @@ impl StackPanel {
}
}
/// Find the first top right in the stack.
pub(super) fn right_top_tab_panel(
&self,
check_parent: bool,
cx: &App,
) -> Option<Entity<TabPanel>> {
if check_parent
&& let Some(parent) = self.parent.as_ref().and_then(|parent| parent.upgrade())
&& let Some(panel) = parent.read(cx).right_top_tab_panel(true, cx)
{
return Some(panel);
}
let panel = if self.axis.is_vertical() {
self.panels.first()
} else {
self.panels.last()
};
if let Some(view) = panel {
if let Ok(tab_panel) = view.view().downcast::<TabPanel>() {
Some(tab_panel)
} else if let Ok(stack_panel) = view.view().downcast::<StackPanel>() {
stack_panel.read(cx).right_top_tab_panel(false, cx)
} else {
None
}
} else {
None
}
}
/// Remove all panels from the stack.
pub(super) fn remove_all_panels(&mut self, _: &mut Window, cx: &mut Context<Self>) {
self.panels.clear();