Get left, right, and bottom docks rendering in the right places in the workspace
Co-authored-by: Julia <julia@zed.dev> Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
co-authored by
Julia
Marshall
parent
13255ef133
commit
13dd912817
@@ -1,7 +1,7 @@
|
||||
use crate::{status_bar::StatusItemView, Axis, Workspace};
|
||||
use gpui::{
|
||||
div, Action, AnyView, AppContext, Div, Entity, EntityId, EventEmitter, FocusHandle,
|
||||
ParentElement, Render, Subscription, View, ViewContext, WeakView, WindowContext,
|
||||
ParentElement, Render, Styled, Subscription, View, ViewContext, WeakView, WindowContext,
|
||||
};
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -428,7 +428,11 @@ impl Render for Dock {
|
||||
type Element = Div<Self>;
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
|
||||
todo!()
|
||||
if let Some(entry) = self.visible_entry() {
|
||||
div().size_full().child(entry.panel.to_any())
|
||||
} else {
|
||||
div()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3642,45 +3642,30 @@ impl Render for Workspace {
|
||||
.border_t()
|
||||
.border_b()
|
||||
.border_color(cx.theme().colors().border)
|
||||
// .children(
|
||||
// Some(
|
||||
// Panel::new("project-panel-outer", cx)
|
||||
// .side(PanelSide::Left)
|
||||
// .child(ProjectPanel::new("project-panel-inner")),
|
||||
// )
|
||||
// .filter(|_| self.is_project_panel_open()),
|
||||
// )
|
||||
// .children(
|
||||
// Some(
|
||||
// Panel::new("collab-panel-outer", cx)
|
||||
// .child(CollabPanel::new("collab-panel-inner"))
|
||||
// .side(PanelSide::Left),
|
||||
// )
|
||||
// .filter(|_| self.is_collab_panel_open()),
|
||||
// )
|
||||
// .child(NotificationToast::new(
|
||||
// "maxbrunsfeld has requested to add you as a contact.".into(),
|
||||
// ))
|
||||
.child(
|
||||
div().flex().flex_col().flex_1().h_full().child(
|
||||
div().flex().flex_1().child(self.center.render(
|
||||
&self.project,
|
||||
&self.follower_states,
|
||||
self.active_call(),
|
||||
&self.active_pane,
|
||||
self.zoomed.as_ref(),
|
||||
&self.app_state,
|
||||
cx,
|
||||
)),
|
||||
), // .children(
|
||||
// Some(
|
||||
// Panel::new("terminal-panel", cx)
|
||||
// .child(Terminal::new())
|
||||
// .allowed_sides(PanelAllowedSides::BottomOnly)
|
||||
// .side(PanelSide::Bottom),
|
||||
// )
|
||||
// .filter(|_| self.is_terminal_open()),
|
||||
// ),
|
||||
div()
|
||||
.flex()
|
||||
.flex_row()
|
||||
.flex_1()
|
||||
.h_full()
|
||||
.child(div().flex().flex_1().child(self.left_dock.clone()))
|
||||
.child(
|
||||
div()
|
||||
.flex()
|
||||
.flex_col()
|
||||
.flex_1()
|
||||
.child(self.center.render(
|
||||
&self.project,
|
||||
&self.follower_states,
|
||||
self.active_call(),
|
||||
&self.active_pane,
|
||||
self.zoomed.as_ref(),
|
||||
&self.app_state,
|
||||
cx,
|
||||
))
|
||||
.child(div().flex().flex_1().child(self.bottom_dock.clone())),
|
||||
)
|
||||
.child(div().flex().flex_1().child(self.right_dock.clone())),
|
||||
), // .children(
|
||||
// Some(
|
||||
// Panel::new("chat-panel-outer", cx)
|
||||
|
||||
Reference in New Issue
Block a user