Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix last thing
Conrad Irwin8049ec674ec4
diff --git a/crates/terminal_view2/src/terminal_view.rs b/crates/terminal_view2/src/terminal_view.rsindex 66dbd95dc4b..c61afb0b944 100644--- a/crates/terminal_view2/src/terminal_view.rs+++ b/crates/terminal_view2/src/terminal_view.rs@@ -63,7 +63,6 @@ pub struct SendKeystroke(String);actions!(Clear, Copy, Paste, ShowCharacterPalette, SearchTest);pub fn init(cx: &mut AppContext) {- workspace::ui::init(cx);terminal_panel::init(cx);terminal::init(cx);diff --git a/crates/ui2/src/components/list.rs b/crates/ui2/src/components/list.rsindex b1a8d43bd88..54758b38031 100644--- a/crates/ui2/src/components/list.rs+++ b/crates/ui2/src/components/list.rs@@ -1,8 +1,9 @@-use gpui::{div, AnyElement, ClickEvent, Div, RenderOnce, Stateful, StatefulInteractiveElement};+use gpui::{+ div, px, AnyElement, ClickEvent, Div, RenderOnce, Stateful, StatefulInteractiveElement,+};use smallvec::SmallVec;use std::rc::Rc;-use crate::settings::user_settings;use crate::{disclosure_control, h_stack, v_stack, Avatar, Icon, IconElement, IconSize, Label, Toggle,};@@ -331,8 +332,6 @@ impl Component for ListItem {type Rendered = Stateful<Div>;fn render(self, cx: &mut WindowContext) -> Self::Rendered {- let settings = user_settings(cx);-let left_content = match self.left_slot.clone() {Some(GraphicSlot::Icon(i)) => Some(h_stack().child(@@ -377,7 +376,7 @@ impl Component for ListItem {// .ml(rems(0.75 * self.indent_level as f32)).children((0..self.indent_level).map(|_| {div()- .w(*settings.list_indent_depth)+ .w(px(4.)).h_full().flex().justify_center()diff --git a/crates/ui2/src/components/panel.rs b/crates/ui2/src/components/panel.rsindex fefc2d4f709..4918d0df95f 100644--- a/crates/ui2/src/components/panel.rs+++ b/crates/ui2/src/components/panel.rs@@ -1,8 +1,8 @@+use gpui::px;use gpui::{prelude::*, AbsoluteLength, AnyElement, Div, RenderOnce};use smallvec::SmallVec;use crate::prelude::*;-use crate::settings::user_settings;use crate::v_stack;#[derive(Default, Debug, PartialEq, Eq, Hash, Clone, Copy)]@@ -75,13 +75,11 @@ impl Component for Panel {impl Panel {pub fn new(id: impl Into<ElementId>, cx: &mut WindowContext) -> Self {- let settings = user_settings(cx);-Self {id: id.into(),current_side: PanelSide::default(),allowed_sides: PanelAllowedSides::default(),- initial_width: *settings.default_panel_size,+ initial_width: px(320.).into(),width: None,children: SmallVec::new(),}diff --git a/crates/workspace2/src/dock.rs b/crates/workspace2/src/dock.rsindex 6da60521936..b44178ceb7d 100644--- a/crates/workspace2/src/dock.rs+++ b/crates/workspace2/src/dock.rs@@ -8,7 +8,9 @@ use schemars::JsonSchema;use serde::{Deserialize, Serialize};use std::sync::Arc;use theme2::ActiveTheme;-use ui::{h_stack, menu_handle, ContextMenu, IconButton, InteractionState, Tooltip};+use ui::{+ h_stack, menu_handle, ContextMenu, IconButton, InteractionState, Label, ListItem, Tooltip,+};pub enum PanelEvent {ChangePosition,@@ -711,25 +713,21 @@ impl Render for PanelButtons {DockPosition::Bottom,];- //CX: PaneContextMenu::build(cx, |mut menu, cx| {- // CX: Menufor position in POSITIONS {if position != dock_position&& panel.position_is_valid(position, cx){- // let panel = panel.clone();- todo!()- // menu = menu.entry(- // ListEntry::new(Label::new(format!(- // "Dock {}",- // position.to_label()- // ))),- // cx.listener(move |_, cx| {- // //What should CX be? CX: Pane- // panel.set_position(position, cx);- // }),- //)+ let panel = panel.clone();+ menu = menu.entry(+ ListItem::new(+ panel.entity_id(),+ Label::new(format!("Dock {}", position.to_label())),+ ),+ move |_, cx| {+ panel.set_position(position, cx);+ },+ )}}menu