This commit is contained in:
2026-08-11 13:30:09 +07:00
parent e77cfe29d9
commit 6f381c68c3
8 changed files with 261 additions and 9 deletions
+15 -6
View File
@@ -21,23 +21,23 @@ pub struct Workspace {
impl Workspace {
pub fn new(window: &mut Window, cx: &mut Context<Self>) -> Self {
let dock =
cx.new(|cx| DockArea::new("dock", Some(1), window, cx).panel_style(PanelStyle::TabBar));
let style = PanelStyle::TabBar;
let dock = cx.new(|cx| DockArea::new("dock", Some(1), window, cx).panel_style(style));
let weak_dock = dock.downgrade();
let sidebar = cx.new(|cx| SidebarPanel::new(weak_dock.clone(), cx));
let weak_sidebar = sidebar.downgrade();
dock.update(cx, |dock_area, cx| {
dock_area.set_left_dock(
DockItem::panel(Arc::new(sidebar.clone())),
Some(px(260.)),
DockItem::panel(Arc::new(sidebar)),
Some(px(240.)),
true,
window,
cx,
);
});
sidebar.update(cx, |sidebar, cx| sidebar.open_explore(window, cx));
let backend = Backend::global(cx);
let connected = backend.read(cx).is_connected();
let sync_progress = backend.read(cx).sync_progress();
@@ -86,6 +86,15 @@ impl Workspace {
passphrase_dialog::open(window, cx);
}
// Open the explore panel after the sidebar has been initialized.
cx.defer_in(window, move |_, window, cx| {
weak_sidebar
.update(cx, |this, cx| {
this.open_explore(window, cx);
})
.ok();
});
Self {
dock,
status,