WIP

Conrad Irwin created

Change summary

Cargo.lock                          |  1 
crates/workspace2/Cargo.toml        |  1 
crates/workspace2/src/dock.rs       |  1 
crates/workspace2/src/pane_group.rs | 39 +++++++++++++++++++++++++++---
crates/workspace2/src/workspace2.rs | 33 +++++++++++++++-----------
5 files changed, 57 insertions(+), 18 deletions(-)

Detailed changes

Cargo.lock 🔗

@@ -10831,6 +10831,7 @@ dependencies = [
  "smallvec",
  "terminal2",
  "theme2",
+ "ui2",
  "util",
  "uuid 1.4.1",
 ]

crates/workspace2/Cargo.toml 🔗

@@ -35,6 +35,7 @@ settings2 = { path = "../settings2" }
 terminal2 = { path = "../terminal2" }
 theme2 = { path = "../theme2" }
 util = { path = "../util" }
+ui = { package = "ui2", path = "../ui2" }
 
 async-recursion = "1.0.0"
 itertools = "0.10"

crates/workspace2/src/dock.rs 🔗

@@ -606,6 +606,7 @@ impl Render for PanelButtons {
     type Element = Div<Self>;
 
     fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
+        // todo!()
         let dock = self.dock.read(cx);
         div().children(
             dock.panel_entries

crates/workspace2/src/pane_group.rs 🔗

@@ -12,6 +12,7 @@ use project2::Project;
 use serde::Deserialize;
 use std::sync::Arc;
 use theme2::ThemeVariant;
+use ui::prelude::*;
 
 const HANDLE_HITBOX_SIZE: f32 = 4.0;
 const HORIZONTAL_MIN_SIZE: f32 = 80.;
@@ -124,7 +125,6 @@ impl PaneGroup {
     pub(crate) fn render(
         &self,
         project: &Model<Project>,
-        theme: &ThemeVariant,
         follower_states: &HashMap<View<Pane>, FollowerState>,
         active_call: Option<&Model<ActiveCall>>,
         active_pane: &View<Pane>,
@@ -135,7 +135,6 @@ impl PaneGroup {
         self.root.render(
             project,
             0,
-            theme,
             follower_states,
             active_call,
             active_pane,
@@ -187,7 +186,6 @@ impl Member {
         &self,
         project: &Model<Project>,
         basis: usize,
-        theme: &ThemeVariant,
         follower_states: &HashMap<View<Pane>, FollowerState>,
         active_call: Option<&Model<ActiveCall>>,
         active_pane: &View<Pane>,
@@ -195,7 +193,40 @@ impl Member {
         app_state: &Arc<AppState>,
         cx: &mut ViewContext<Workspace>,
     ) -> AnyElement<Workspace> {
-        todo!()
+        match self {
+            Member::Pane(pane) => {
+                let pane_element = if Some(&**pane) == zoomed {
+                    None
+                } else {
+                    Some(pane)
+                };
+
+                //         Stack::new()
+                //             .with_child(pane_element.contained().with_border(leader_border))
+                //             .with_children(leader_status_box)
+                //             .into_any()
+
+                let el = div()
+                    .flex()
+                    .flex_1()
+                    .gap_px()
+                    .w_full()
+                    .h_full()
+                    .bg(cx.theme().colors().editor)
+                    .children();
+            }
+            Member::Axis(axis) => axis.render(
+                project,
+                basis + 1,
+                theme,
+                follower_states,
+                active_call,
+                active_pane,
+                zoomed,
+                app_state,
+                cx,
+            ),
+        }
 
         // enum FollowIntoExternalProject {}
 

crates/workspace2/src/workspace2.rs 🔗

@@ -3803,20 +3803,25 @@ impl Render for Workspace {
                     //     "maxbrunsfeld has requested to add you as a contact.".into(),
                     // ))
                     .child(
-                        div()
-                            .flex()
-                            .flex_col()
-                            .flex_1()
-                            .h_full()
-                            .child(div().flex().flex_1()), // .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_col().flex_1().h_full().child(
+                            div().flex().flex_1().child(self.center.render(
+                                project,
+                                follower_states,
+                                active_call,
+                                active_pane,
+                                zoomed,
+                                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()),
+                           // ),
                     ), // .children(
                        //     Some(
                        //         Panel::new("chat-panel-outer", cx)