wip
This commit is contained in:
parent
0c466f806c
commit
73f0459a0f
5 changed files with 25 additions and 21 deletions
|
@ -137,11 +137,7 @@ pub struct Dock {
|
|||
}
|
||||
|
||||
impl Dock {
|
||||
pub fn new(
|
||||
serialized_pane: SerializedPane,
|
||||
default_item_factory: DefaultItemFactory,
|
||||
cx: &mut ViewContext<Workspace>,
|
||||
) -> Self {
|
||||
pub fn new(default_item_factory: DefaultItemFactory, cx: &mut ViewContext<Workspace>) -> Self {
|
||||
let anchor = cx.global::<Settings>().default_dock_anchor;
|
||||
let pane = cx.add_view(|cx| Pane::new(Some(anchor), cx));
|
||||
pane.update(cx, |pane, cx| {
|
||||
|
|
|
@ -15,6 +15,7 @@ use anyhow::{anyhow, Context, Result};
|
|||
use call::ActiveCall;
|
||||
use client::{proto, Client, PeerId, TypedEnvelope, UserStore};
|
||||
use collections::{hash_map, HashMap, HashSet};
|
||||
use db::{SerializedWorkspace, WorkspaceId};
|
||||
use dock::{DefaultItemFactory, Dock, ToggleDockButton};
|
||||
use drag_and_drop::DragAndDrop;
|
||||
use fs::{self, Fs};
|
||||
|
@ -1064,6 +1065,7 @@ pub enum Event {
|
|||
|
||||
pub struct Workspace {
|
||||
weak_self: WeakViewHandle<Self>,
|
||||
db_id: WorkspaceId,
|
||||
client: Arc<Client>,
|
||||
user_store: ModelHandle<client::UserStore>,
|
||||
remote_entity_subscription: Option<client::Subscription>,
|
||||
|
@ -1110,8 +1112,8 @@ enum FollowerItem {
|
|||
|
||||
impl Workspace {
|
||||
pub fn new(
|
||||
serialized_workspace: SerializedWorkspace,
|
||||
project: ModelHandle<Project>,
|
||||
serialized_workspace: SerializedWorkspace,
|
||||
dock_default_factory: DefaultItemFactory,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) -> Self {
|
||||
|
@ -1175,7 +1177,7 @@ impl Workspace {
|
|||
|
||||
cx.emit_global(WorkspaceCreated(weak_handle.clone()));
|
||||
|
||||
let dock = Dock::new(cx, dock_default_factory);
|
||||
let dock = Dock::new(dock_default_factory, cx);
|
||||
let dock_pane = dock.pane().clone();
|
||||
|
||||
let left_sidebar = cx.add_view(|_| Sidebar::new(SidebarSide::Left));
|
||||
|
@ -1207,6 +1209,7 @@ impl Workspace {
|
|||
let mut this = Workspace {
|
||||
modal: None,
|
||||
weak_self: weak_handle,
|
||||
db_id: serialized_workspace.workspace_id,
|
||||
center: PaneGroup::new(center_pane.clone()),
|
||||
dock,
|
||||
// When removing an item, the last element remaining in this array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue