diff --git a/crates/command_palette2/src/command_palette.rs b/crates/command_palette2/src/command_palette.rs index 139d8a16c76602c0f9e8aee4a93e802e5273aeb4..cb0f2c20d41f5f48b016f5cf74395343e9e4e0b6 100644 --- a/crates/command_palette2/src/command_palette.rs +++ b/crates/command_palette2/src/command_palette.rs @@ -1,8 +1,8 @@ use collections::{CommandPaletteFilter, HashMap}; use fuzzy::{StringMatch, StringMatchCandidate}; use gpui::{ - actions, div, prelude::*, Action, AppContext, Component, EventEmitter, FocusHandle, Keystroke, - Node, ParentComponent, Render, Styled, View, ViewContext, VisualContext, WeakView, + actions, div, prelude::*, Action, AppContext, Component, Div, EventEmitter, FocusHandle, + Keystroke, ParentComponent, Render, Styled, View, ViewContext, VisualContext, WeakView, WindowContext, }; use picker::{Picker, PickerDelegate}; @@ -77,7 +77,7 @@ impl Modal for CommandPalette { } impl Render for CommandPalette { - type Element = Node; + type Element = Div; fn render(&mut self, _cx: &mut ViewContext) -> Self::Element { v_stack().w_96().child(self.picker.clone()) @@ -148,7 +148,7 @@ impl CommandPaletteDelegate { } impl PickerDelegate for CommandPaletteDelegate { - type ListItem = Node>; + type ListItem = Div>; fn placeholder_text(&self) -> Arc { "Execute a command...".into() diff --git a/crates/go_to_line2/src/go_to_line.rs b/crates/go_to_line2/src/go_to_line.rs index 9f2ba6db219e899d4cf6df1f91575943cf9427aa..abafe93cdd28947ba6e4b7cde2fa5bdd20393e53 100644 --- a/crates/go_to_line2/src/go_to_line.rs +++ b/crates/go_to_line2/src/go_to_line.rs @@ -1,7 +1,7 @@ use editor::{display_map::ToDisplayPoint, scroll::autoscroll::Autoscroll, Editor}; use gpui::{ - actions, div, prelude::*, AppContext, EventEmitter, Node, ParentComponent, Render, - SharedString, Styled, Subscription, View, ViewContext, VisualContext, WindowContext, + actions, div, prelude::*, AppContext, Div, EventEmitter, ParentComponent, Render, SharedString, + Styled, Subscription, View, ViewContext, VisualContext, WindowContext, }; use text::{Bias, Point}; use theme::ActiveTheme; @@ -145,7 +145,7 @@ impl GoToLine { } impl Render for GoToLine { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { modal(cx) diff --git a/crates/gpui2/src/elements/node.rs b/crates/gpui2/src/elements/div.rs similarity index 99% rename from crates/gpui2/src/elements/node.rs rename to crates/gpui2/src/elements/div.rs index 7e61c8fbb496853a906a801eddbe57c5c794580f..c0f916ae966033749cd78207bd42f14597906c11 100644 --- a/crates/gpui2/src/elements/node.rs +++ b/crates/gpui2/src/elements/div.rs @@ -538,37 +538,37 @@ pub type KeyUpListener = pub type ActionListener = Box) + 'static>; -pub fn div() -> Node { - Node { +pub fn div() -> Div { + Div { interactivity: Interactivity::default(), children: SmallVec::default(), } } -pub struct Node { +pub struct Div { interactivity: Interactivity, children: SmallVec<[AnyElement; 2]>, } -impl Styled for Node { +impl Styled for Div { fn style(&mut self) -> &mut StyleRefinement { &mut self.interactivity.base_style } } -impl InteractiveComponent for Node { +impl InteractiveComponent for Div { fn interactivity(&mut self) -> &mut Interactivity { &mut self.interactivity } } -impl ParentComponent for Node { +impl ParentComponent for Div { fn children_mut(&mut self) -> &mut SmallVec<[AnyElement; 2]> { &mut self.children } } -impl Element for Node { +impl Element for Div { type ElementState = NodeState; fn element_id(&self) -> Option { @@ -671,7 +671,7 @@ impl Element for Node { } } -impl Component for Node { +impl Component for Div { fn render(self) -> AnyElement { AnyElement::new(self) } diff --git a/crates/gpui2/src/elements.rs b/crates/gpui2/src/elements/mod.rs similarity index 67% rename from crates/gpui2/src/elements.rs rename to crates/gpui2/src/elements/mod.rs index 5bf9e6202b1a81374592bb1e03b9b277ce3365fa..eb061f7d34c8e77c1a366123818b253d33620c7a 100644 --- a/crates/gpui2/src/elements.rs +++ b/crates/gpui2/src/elements/mod.rs @@ -1,13 +1,11 @@ -// mod div; +mod div; mod img; -mod node; mod svg; mod text; mod uniform_list; -// pub use div::*; +pub use div::*; pub use img::*; -pub use node::*; pub use svg::*; pub use text::*; pub use uniform_list::*; diff --git a/crates/gpui2/src/interactive.rs b/crates/gpui2/src/interactive.rs index cb8be7c2962db30df0c29409245ad6882dd9360a..5ce78553fd60b59fcb5e531453d96116afa756be 100644 --- a/crates/gpui2/src/interactive.rs +++ b/crates/gpui2/src/interactive.rs @@ -1,5 +1,5 @@ use crate::{ - div, point, Component, FocusHandle, Keystroke, Modifiers, Node, Pixels, Point, Render, + div, point, Component, FocusHandle, Keystroke, Modifiers, Div, Pixels, Point, Render, ViewContext, }; use smallvec::SmallVec; @@ -194,7 +194,7 @@ impl Deref for MouseExitEvent { pub struct ExternalPaths(pub(crate) SmallVec<[PathBuf; 2]>); impl Render for ExternalPaths { - type Element = Node; + type Element = Div; fn render(&mut self, _: &mut ViewContext) -> Self::Element { div() // Intentionally left empty because the platform will render icons for the dragged files @@ -286,7 +286,7 @@ pub struct FocusEvent { #[cfg(test)] mod test { use crate::{ - self as gpui, div, FocusHandle, InteractiveComponent, KeyBinding, Keystroke, Node, + self as gpui, div, FocusHandle, InteractiveComponent, KeyBinding, Keystroke, Div, ParentComponent, Render, Stateful, TestAppContext, VisualContext, }; @@ -299,7 +299,7 @@ mod test { actions!(TestAction); impl Render for TestView { - type Element = Stateful>; + type Element = Stateful>; fn render(&mut self, _: &mut gpui::ViewContext) -> Self::Element { div().id("testview").child( diff --git a/crates/picker2/src/picker2.rs b/crates/picker2/src/picker2.rs index 189c07b49afde5c06fe327aa1de10422d35a878b..0a2a50deb6a1610011c893b843d5daa01ad748cb 100644 --- a/crates/picker2/src/picker2.rs +++ b/crates/picker2/src/picker2.rs @@ -1,6 +1,6 @@ use editor::Editor; use gpui::{ - div, uniform_list, Component, Node, ParentComponent, Render, Styled, Task, + div, uniform_list, Component, Div, ParentComponent, Render, Styled, Task, UniformListScrollHandle, View, ViewContext, VisualContext, WindowContext, }; use std::{cmp, sync::Arc}; @@ -139,7 +139,7 @@ impl Picker { } impl Render for Picker { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { div() diff --git a/crates/storybook2/src/stories/colors.rs b/crates/storybook2/src/stories/colors.rs index a5e9efc0da505973f2d5106352a9108d40d3c085..4f8c54fa6fa67404453737f33a79113e018e346f 100644 --- a/crates/storybook2/src/stories/colors.rs +++ b/crates/storybook2/src/stories/colors.rs @@ -1,12 +1,12 @@ use crate::story::Story; -use gpui::{prelude::*, px, Node, Render}; +use gpui::{prelude::*, px, Div, Render}; use theme2::{default_color_scales, ColorScaleStep}; use ui::prelude::*; pub struct ColorsStory; impl Render for ColorsStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let color_scales = default_color_scales(); diff --git a/crates/storybook2/src/stories/focus.rs b/crates/storybook2/src/stories/focus.rs index a6b27c460df399e14a42a43561ac4cb79bd33769..ff9a4da876a021a79b7ccb9a69c89d604122182d 100644 --- a/crates/storybook2/src/stories/focus.rs +++ b/crates/storybook2/src/stories/focus.rs @@ -1,5 +1,5 @@ use gpui::{ - actions, div, prelude::*, FocusHandle, Focusable, KeyBinding, Node, Render, Stateful, View, + actions, div, prelude::*, FocusHandle, Focusable, KeyBinding, Div, Render, Stateful, View, WindowContext, }; use theme2::ActiveTheme; @@ -27,7 +27,7 @@ impl FocusStory { } impl Render for FocusStory { - type Element = Focusable>>; + type Element = Focusable>>; fn render(&mut self, cx: &mut gpui::ViewContext) -> Self::Element { let theme = cx.theme(); diff --git a/crates/storybook2/src/stories/kitchen_sink.rs b/crates/storybook2/src/stories/kitchen_sink.rs index 0a165eff7496fb6a536a7d69a8f813080bb294b1..507aa8db2d5db7f0d24fd33aaacc34f04a700170 100644 --- a/crates/storybook2/src/stories/kitchen_sink.rs +++ b/crates/storybook2/src/stories/kitchen_sink.rs @@ -1,5 +1,5 @@ use crate::{story::Story, story_selector::ComponentStory}; -use gpui::{prelude::*, Node, Render, Stateful, View}; +use gpui::{prelude::*, Div, Render, Stateful, View}; use strum::IntoEnumIterator; use ui::prelude::*; @@ -12,7 +12,7 @@ impl KitchenSinkStory { } impl Render for KitchenSinkStory { - type Element = Stateful>; + type Element = Stateful>; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let component_stories = ComponentStory::iter() diff --git a/crates/storybook2/src/stories/picker.rs b/crates/storybook2/src/stories/picker.rs index bba8ae9990c36ea6c6d3d312f77bacaf9a05f059..eb4a3b88ea5759db2fe007390923c6a7f5184f59 100644 --- a/crates/storybook2/src/stories/picker.rs +++ b/crates/storybook2/src/stories/picker.rs @@ -1,5 +1,5 @@ use fuzzy::StringMatchCandidate; -use gpui::{div, prelude::*, KeyBinding, Node, Render, Styled, Task, View, WindowContext}; +use gpui::{div, prelude::*, KeyBinding, Div, Render, Styled, Task, View, WindowContext}; use picker::{Picker, PickerDelegate}; use std::sync::Arc; use theme2::ActiveTheme; @@ -34,7 +34,7 @@ impl Delegate { } impl PickerDelegate for Delegate { - type ListItem = Node>; + type ListItem = Div>; fn match_count(&self) -> usize { self.candidates.len() @@ -203,7 +203,7 @@ impl PickerStory { } impl Render for PickerStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut gpui::ViewContext) -> Self::Element { div() diff --git a/crates/storybook2/src/stories/scroll.rs b/crates/storybook2/src/stories/scroll.rs index c5675b5681ca1af1208be4fbaa67a8d44fd6c561..c5549e56d0e21c1c4fd6cd9c682cc60b209651a2 100644 --- a/crates/storybook2/src/stories/scroll.rs +++ b/crates/storybook2/src/stories/scroll.rs @@ -1,5 +1,5 @@ use gpui::{ - div, prelude::*, px, Node, Render, SharedString, Stateful, Styled, View, WindowContext, + div, prelude::*, px, Div, Render, SharedString, Stateful, Styled, View, WindowContext, }; use theme2::ActiveTheme; @@ -12,7 +12,7 @@ impl ScrollStory { } impl Render for ScrollStory { - type Element = Stateful>; + type Element = Stateful>; fn render(&mut self, cx: &mut gpui::ViewContext) -> Self::Element { let theme = cx.theme(); diff --git a/crates/storybook2/src/stories/text.rs b/crates/storybook2/src/stories/text.rs index 86ab2fce9998cdd4edbbb2fb07800b0e2a3eea6b..6fc76ab9073c770dba90626611c83313c7b6445a 100644 --- a/crates/storybook2/src/stories/text.rs +++ b/crates/storybook2/src/stories/text.rs @@ -1,4 +1,4 @@ -use gpui::{div, white, Node, ParentComponent, Render, Styled, View, VisualContext, WindowContext}; +use gpui::{div, white, Div, ParentComponent, Render, Styled, View, VisualContext, WindowContext}; pub struct TextStory; @@ -9,7 +9,7 @@ impl TextStory { } impl Render for TextStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut gpui::ViewContext) -> Self::Element { div().size_full().bg(white()).child(concat!( diff --git a/crates/storybook2/src/stories/z_index.rs b/crates/storybook2/src/stories/z_index.rs index 259685b9fa7f402a3b2eec3b8b9c1e4d8e165cf2..46ec0f4a3511ea2b3a3cc7999e203a62d35a01d6 100644 --- a/crates/storybook2/src/stories/z_index.rs +++ b/crates/storybook2/src/stories/z_index.rs @@ -1,4 +1,4 @@ -use gpui::{px, rgb, Hsla, Node, Render}; +use gpui::{px, rgb, Div, Hsla, Render}; use ui::prelude::*; use crate::story::Story; @@ -8,7 +8,7 @@ use crate::story::Story; pub struct ZIndexStory; impl Render for ZIndexStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) @@ -77,7 +77,7 @@ trait Styles: Styled + Sized { } } -impl Styles for Node {} +impl Styles for Div {} #[derive(Component)] struct ZIndexExample { diff --git a/crates/storybook2/src/storybook2.rs b/crates/storybook2/src/storybook2.rs index f20aa5909554761b47d40d8a4a11115dbd8f11c8..f0ba124162d546bcdbdc1fce12e986364f950dad 100644 --- a/crates/storybook2/src/storybook2.rs +++ b/crates/storybook2/src/storybook2.rs @@ -9,7 +9,7 @@ use std::sync::Arc; use clap::Parser; use gpui::{ - div, px, size, AnyView, AppContext, Bounds, Node, Render, ViewContext, VisualContext, + div, px, size, AnyView, AppContext, Bounds, Div, Render, ViewContext, VisualContext, WindowBounds, WindowOptions, }; use log::LevelFilter; @@ -107,7 +107,7 @@ impl StoryWrapper { } impl Render for StoryWrapper { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { div() diff --git a/crates/theme2/src/players.rs b/crates/theme2/src/players.rs index 32b3504b65f9004e1d6555170cb4bfdd5a406506..28489285a7602e99ff21c847269b9f8669aefc5a 100644 --- a/crates/theme2/src/players.rs +++ b/crates/theme2/src/players.rs @@ -40,12 +40,12 @@ pub use stories::*; mod stories { use super::*; use crate::{ActiveTheme, Story}; - use gpui::{div, img, px, Node, ParentComponent, Render, Styled, ViewContext}; + use gpui::{div, img, px, Div, ParentComponent, Render, Styled, ViewContext}; pub struct PlayerStory; impl Render for PlayerStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx).child( diff --git a/crates/theme2/src/story.rs b/crates/theme2/src/story.rs index 00cb20df9268c36d1235a7c3c4b88ba796ba133a..4296d4f99c4e2f4dfad0cbf1b60eef90efa3d0d0 100644 --- a/crates/theme2/src/story.rs +++ b/crates/theme2/src/story.rs @@ -1,11 +1,11 @@ -use gpui::{div, Component, Node, ParentComponent, Styled, ViewContext}; +use gpui::{div, Component, Div, ParentComponent, Styled, ViewContext}; use crate::ActiveTheme; pub struct Story {} impl Story { - pub fn container(cx: &mut ViewContext) -> Node { + pub fn container(cx: &mut ViewContext) -> Div { div() .size_full() .flex() diff --git a/crates/ui2/src/components/avatar.rs b/crates/ui2/src/components/avatar.rs index d270f2fd323c69ee3e9fffbee12ae9117c1f6473..d083d8fd463e144e236e5c625caa92f237f3fce4 100644 --- a/crates/ui2/src/components/avatar.rs +++ b/crates/ui2/src/components/avatar.rs @@ -44,12 +44,12 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct AvatarStory; impl Render for AvatarStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/components/button.rs b/crates/ui2/src/components/button.rs index eeb8ddb90687766f67277ff01f340b91b25a91a7..1c36eab44f1972bdb65066a849cf85642db57706 100644 --- a/crates/ui2/src/components/button.rs +++ b/crates/ui2/src/components/button.rs @@ -236,13 +236,13 @@ pub use stories::*; mod stories { use super::*; use crate::{h_stack, v_stack, LabelColor, Story}; - use gpui::{rems, Node, Render}; + use gpui::{rems, Div, Render}; use strum::IntoEnumIterator; pub struct ButtonStory; impl Render for ButtonStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let states = InteractionState::iter(); diff --git a/crates/ui2/src/components/checkbox.rs b/crates/ui2/src/components/checkbox.rs index c2a0cfdc2f539f60846739793260e35c71156e69..971da8338b5d866b73baad53fa199dfc4cb90598 100644 --- a/crates/ui2/src/components/checkbox.rs +++ b/crates/ui2/src/components/checkbox.rs @@ -171,12 +171,12 @@ pub use stories::*; mod stories { use super::*; use crate::{h_stack, Story}; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct CheckboxStory; impl Render for CheckboxStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/components/context_menu.rs b/crates/ui2/src/components/context_menu.rs index a33f10c296f92e3ebd25123e0b1a3a8b160de816..117be127798bd56f9d0c3963f8119832aa170550 100644 --- a/crates/ui2/src/components/context_menu.rs +++ b/crates/ui2/src/components/context_menu.rs @@ -65,12 +65,12 @@ pub use stories::*; mod stories { use super::*; use crate::story::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct ContextMenuStory; impl Render for ContextMenuStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/components/details.rs b/crates/ui2/src/components/details.rs index 44c433179a94b291145dcb363f4cc4d69c869180..f138290f17fd3b6fc325f0972f62f6aa6f996ed1 100644 --- a/crates/ui2/src/components/details.rs +++ b/crates/ui2/src/components/details.rs @@ -47,12 +47,12 @@ pub use stories::*; mod stories { use super::*; use crate::{Button, Story}; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct DetailsStory; impl Render for DetailsStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/components/elevated_surface.rs b/crates/ui2/src/components/elevated_surface.rs index 3a1699a64a9678687718eb14cd856b26370904f5..fff232d7ed6f19739f80f9a1913e4c1d0fa69628 100644 --- a/crates/ui2/src/components/elevated_surface.rs +++ b/crates/ui2/src/components/elevated_surface.rs @@ -1,11 +1,11 @@ -use gpui::Node; +use gpui::Div; use crate::{prelude::*, v_stack}; /// Create an elevated surface. /// /// Must be used inside of a relative parent element -pub fn elevated_surface(level: ElevationIndex, cx: &mut ViewContext) -> Node { +pub fn elevated_surface(level: ElevationIndex, cx: &mut ViewContext) -> Div { let colors = cx.theme().colors(); // let shadow = BoxShadow { @@ -23,6 +23,6 @@ pub fn elevated_surface(level: ElevationIndex, cx: &mut ViewContext< .shadow(level.shadow()) } -pub fn modal(cx: &mut ViewContext) -> Node { +pub fn modal(cx: &mut ViewContext) -> Div { elevated_surface(ElevationIndex::ModalSurface, cx) } diff --git a/crates/ui2/src/components/facepile.rs b/crates/ui2/src/components/facepile.rs index 43fd233458fbb03d3faff2415e1ffeb48aef23f2..efac4925f80a579bfc9deeca273fbf64aad10c5f 100644 --- a/crates/ui2/src/components/facepile.rs +++ b/crates/ui2/src/components/facepile.rs @@ -33,12 +33,12 @@ pub use stories::*; mod stories { use super::*; use crate::{static_players, Story}; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct FacepileStory; impl Render for FacepileStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let players = static_players(); diff --git a/crates/ui2/src/components/icon.rs b/crates/ui2/src/components/icon.rs index ce980a879bf26db0d1ed9da32656746d237b79a4..907f3f91871b5c614944e821244d10228d2853bb 100644 --- a/crates/ui2/src/components/icon.rs +++ b/crates/ui2/src/components/icon.rs @@ -204,7 +204,7 @@ pub use stories::*; #[cfg(feature = "stories")] mod stories { - use gpui::{Node, Render}; + use gpui::{Div, Render}; use strum::IntoEnumIterator; use crate::Story; @@ -214,7 +214,7 @@ mod stories { pub struct IconStory; impl Render for IconStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let icons = Icon::iter(); diff --git a/crates/ui2/src/components/input.rs b/crates/ui2/src/components/input.rs index d873d6a5cbf86f343febb820e817985ee98dbe3f..4db9222a0ec5bd70090afb0f41728d49c7d3e382 100644 --- a/crates/ui2/src/components/input.rs +++ b/crates/ui2/src/components/input.rs @@ -110,12 +110,12 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct InputStory; impl Render for InputStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/components/keybinding.rs b/crates/ui2/src/components/keybinding.rs index 86e876d24502624438f683abe242eac7d25144cf..bd02e694edd45561373f39e2673d7e290dcf30cb 100644 --- a/crates/ui2/src/components/keybinding.rs +++ b/crates/ui2/src/components/keybinding.rs @@ -158,13 +158,13 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; use itertools::Itertools; pub struct KeybindingStory; impl Render for KeybindingStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let all_modifier_permutations = ModifierKey::iter().permutations(2); diff --git a/crates/ui2/src/components/label.rs b/crates/ui2/src/components/label.rs index 497ebe677312703d49ed32ed2339d12a191ab938..827ba87918a0cd4dd3f3255c8b7852436ea06a79 100644 --- a/crates/ui2/src/components/label.rs +++ b/crates/ui2/src/components/label.rs @@ -196,12 +196,12 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct LabelStory; impl Render for LabelStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/components/palette.rs b/crates/ui2/src/components/palette.rs index 4a753215f0940c063e6737ded9d9c2bcf854eff3..249e577ff1048efd305b659a535ec04d6ebcc93d 100644 --- a/crates/ui2/src/components/palette.rs +++ b/crates/ui2/src/components/palette.rs @@ -159,7 +159,7 @@ pub use stories::*; #[cfg(feature = "stories")] mod stories { - use gpui::{Node, Render}; + use gpui::{Div, Render}; use crate::{ModifierKeys, Story}; @@ -168,7 +168,7 @@ mod stories { pub struct PaletteStory; impl Render for PaletteStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { { diff --git a/crates/ui2/src/components/panel.rs b/crates/ui2/src/components/panel.rs index 2b317b0bc1d02773d6bcc0be20241e464ebb3299..e16f203599c49519ebfb546cd2a61e06828db672 100644 --- a/crates/ui2/src/components/panel.rs +++ b/crates/ui2/src/components/panel.rs @@ -126,12 +126,12 @@ pub use stories::*; mod stories { use super::*; use crate::{Label, Story}; - use gpui::{InteractiveComponent, Node, Render}; + use gpui::{InteractiveComponent, Div, Render}; pub struct PanelStory; impl Render for PanelStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/components/stack.rs b/crates/ui2/src/components/stack.rs index d705863ad40a4cd9368f5e07be030ffda53be593..d3d7a75aa76b8765a97b3dcc0c92c498cbbb7d24 100644 --- a/crates/ui2/src/components/stack.rs +++ b/crates/ui2/src/components/stack.rs @@ -1,17 +1,17 @@ -use gpui::{div, Node}; +use gpui::{div, Div}; use crate::StyledExt; /// Horizontally stacks elements. /// /// Sets `flex()`, `flex_row()`, `items_center()` -pub fn h_stack() -> Node { +pub fn h_stack() -> Div { div().h_flex() } /// Vertically stacks elements. /// /// Sets `flex()`, `flex_col()` -pub fn v_stack() -> Node { +pub fn v_stack() -> Div { div().v_flex() } diff --git a/crates/ui2/src/components/tab.rs b/crates/ui2/src/components/tab.rs index fe993555b91094e289181bdc3b1976153dc88e49..268098a579f8c7f8a9faac77498b28f13bac11a9 100644 --- a/crates/ui2/src/components/tab.rs +++ b/crates/ui2/src/components/tab.rs @@ -1,6 +1,6 @@ use crate::prelude::*; use crate::{Icon, IconColor, IconElement, Label, LabelColor}; -use gpui::{prelude::*, red, ElementId, Node, Render, View}; +use gpui::{prelude::*, red, Div, ElementId, Render, View}; #[derive(Component, Clone)] pub struct Tab { @@ -21,7 +21,7 @@ struct TabDragState { } impl Render for TabDragState { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { div().w_8().h_4().bg(red()) @@ -178,7 +178,7 @@ mod stories { pub struct TabStory; impl Render for TabStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let git_statuses = GitStatus::iter(); diff --git a/crates/ui2/src/components/toast.rs b/crates/ui2/src/components/toast.rs index 2f07bbc3e09d939d3c94b0d9c41f8a1361ea4b86..0fcfe6038b97e3b6ba8cc3f88db8cd12f8b2bfc0 100644 --- a/crates/ui2/src/components/toast.rs +++ b/crates/ui2/src/components/toast.rs @@ -69,7 +69,7 @@ pub use stories::*; #[cfg(feature = "stories")] mod stories { - use gpui::{Node, Render}; + use gpui::{Div, Render}; use crate::{Label, Story}; @@ -78,7 +78,7 @@ mod stories { pub struct ToastStory; impl Render for ToastStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/components/tooltip.rs b/crates/ui2/src/components/tooltip.rs index 6c5fa7bc2bb2ec85044fcc8a6be3d02ee7454611..80c6863f6815cd97aa63b81f890ed337000ea3f8 100644 --- a/crates/ui2/src/components/tooltip.rs +++ b/crates/ui2/src/components/tooltip.rs @@ -1,4 +1,4 @@ -use gpui::{div, Node, ParentComponent, Render, SharedString, Styled, ViewContext}; +use gpui::{div, Div, ParentComponent, Render, SharedString, Styled, ViewContext}; use theme2::ActiveTheme; #[derive(Clone, Debug)] @@ -13,7 +13,7 @@ impl TextTooltip { } impl Render for TextTooltip { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let theme = cx.theme(); diff --git a/crates/ui2/src/story.rs b/crates/ui2/src/story.rs index cf5737a2454eff52bc64cc76338a64fbee09350a..94e38267f4c5b160365317c4e597a76748c05d6f 100644 --- a/crates/ui2/src/story.rs +++ b/crates/ui2/src/story.rs @@ -1,11 +1,11 @@ -use gpui::Node; +use gpui::Div; use crate::prelude::*; pub struct Story {} impl Story { - pub fn container(cx: &mut ViewContext) -> Node { + pub fn container(cx: &mut ViewContext) -> Div { div() .size_full() .flex() diff --git a/crates/ui2/src/to_extract/assistant_panel.rs b/crates/ui2/src/to_extract/assistant_panel.rs index 59d90591220118d15d4e67d5eb2ff35001d24748..f111dad83024f539d033701bfab66a7c10dbb446 100644 --- a/crates/ui2/src/to_extract/assistant_panel.rs +++ b/crates/ui2/src/to_extract/assistant_panel.rs @@ -77,11 +77,11 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct AssistantPanelStory; impl Render for AssistantPanelStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/breadcrumb.rs b/crates/ui2/src/to_extract/breadcrumb.rs index c113c641684b2f8289a55046e76fa5664f7b03f1..fd43a5b3bf58556ca003e00114b1f060f82ba453 100644 --- a/crates/ui2/src/to_extract/breadcrumb.rs +++ b/crates/ui2/src/to_extract/breadcrumb.rs @@ -1,5 +1,5 @@ use crate::{h_stack, prelude::*, HighlightedText}; -use gpui::{prelude::*, Node}; +use gpui::{prelude::*, Div}; use std::path::PathBuf; #[derive(Clone)] @@ -16,7 +16,7 @@ impl Breadcrumb { Self { path, symbols } } - fn render_separator(&self, cx: &WindowContext) -> Node { + fn render_separator(&self, cx: &WindowContext) -> Div { div() .child(" › ") .text_color(cx.theme().colors().text_muted) @@ -77,7 +77,7 @@ mod stories { pub struct BreadcrumbStory; impl Render for BreadcrumbStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/buffer.rs b/crates/ui2/src/to_extract/buffer.rs index b04f2221d3158d658600f0650ab820abfd65a26b..aa4bebc9d5d5cdaa23f1429af7d64b71751c99c0 100644 --- a/crates/ui2/src/to_extract/buffer.rs +++ b/crates/ui2/src/to_extract/buffer.rs @@ -235,12 +235,12 @@ mod stories { empty_buffer_example, hello_world_rust_buffer_example, hello_world_rust_buffer_with_status_example, Story, }; - use gpui::{rems, Node, Render}; + use gpui::{rems, Div, Render}; pub struct BufferStory; impl Render for BufferStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/buffer_search.rs b/crates/ui2/src/to_extract/buffer_search.rs index 0e6fffa5a705ddc157a9f78e004c9c0eb6aa85be..9993cd361294067112c6b629ef9f5e2698e4e3cb 100644 --- a/crates/ui2/src/to_extract/buffer_search.rs +++ b/crates/ui2/src/to_extract/buffer_search.rs @@ -1,4 +1,4 @@ -use gpui::{Node, Render, View, VisualContext}; +use gpui::{Div, Render, View, VisualContext}; use crate::prelude::*; use crate::{h_stack, Icon, IconButton, IconColor, Input}; @@ -27,9 +27,9 @@ impl BufferSearch { } impl Render for BufferSearch { - type Element = Node; + type Element = Div; - fn render(&mut self, cx: &mut ViewContext) -> Node { + fn render(&mut self, cx: &mut ViewContext) -> Div { h_stack() .bg(cx.theme().colors().toolbar_background) .p_2() diff --git a/crates/ui2/src/to_extract/chat_panel.rs b/crates/ui2/src/to_extract/chat_panel.rs index 13f35468ff9a141f2474558712b59f04e8c92090..fcc8e6a46e8b7d17e2b2496180da0ce11b2fe32c 100644 --- a/crates/ui2/src/to_extract/chat_panel.rs +++ b/crates/ui2/src/to_extract/chat_panel.rs @@ -107,7 +107,7 @@ pub use stories::*; #[cfg(feature = "stories")] mod stories { use chrono::DateTime; - use gpui::{Node, Render}; + use gpui::{Div, Render}; use crate::{Panel, Story}; @@ -116,7 +116,7 @@ mod stories { pub struct ChatPanelStory; impl Render for ChatPanelStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/collab_panel.rs b/crates/ui2/src/to_extract/collab_panel.rs index d2ac353e0530577ca85059e90013278486cbf37b..256a648c0d42e39cfaccc9c4115d0ff431df8c85 100644 --- a/crates/ui2/src/to_extract/collab_panel.rs +++ b/crates/ui2/src/to_extract/collab_panel.rs @@ -93,12 +93,12 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct CollabPanelStory; impl Render for CollabPanelStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/command_palette.rs b/crates/ui2/src/to_extract/command_palette.rs index 8a9c61490cd525d91f70eef84ebaa8ffd5583baf..8a9461c796d053e45fb768f3db4c14f1364f0d27 100644 --- a/crates/ui2/src/to_extract/command_palette.rs +++ b/crates/ui2/src/to_extract/command_palette.rs @@ -27,7 +27,7 @@ pub use stories::*; #[cfg(feature = "stories")] mod stories { - use gpui::{Node, Render}; + use gpui::{Div, Render}; use crate::Story; @@ -36,7 +36,7 @@ mod stories { pub struct CommandPaletteStory; impl Render for CommandPaletteStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/copilot.rs b/crates/ui2/src/to_extract/copilot.rs index 2a2c2c4a2707be09567df13d6611d8f13c57d37a..8750ab3c51a28cd1f91f67f09c4cd7d419a7b98b 100644 --- a/crates/ui2/src/to_extract/copilot.rs +++ b/crates/ui2/src/to_extract/copilot.rs @@ -25,7 +25,7 @@ pub use stories::*; #[cfg(feature = "stories")] mod stories { - use gpui::{Node, Render}; + use gpui::{Div, Render}; use crate::Story; @@ -34,7 +34,7 @@ mod stories { pub struct CopilotModalStory; impl Render for CopilotModalStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/editor_pane.rs b/crates/ui2/src/to_extract/editor_pane.rs index 4546c24794c961e79dd21b0fd620bef6df94e435..fd21e81242c34237f9d16fb63f66312ebc678fbf 100644 --- a/crates/ui2/src/to_extract/editor_pane.rs +++ b/crates/ui2/src/to_extract/editor_pane.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use gpui::{Node, Render, View, VisualContext}; +use gpui::{Div, Render, View, VisualContext}; use crate::prelude::*; use crate::{ @@ -48,9 +48,9 @@ impl EditorPane { } impl Render for EditorPane { - type Element = Node; + type Element = Div; - fn render(&mut self, cx: &mut ViewContext) -> Node { + fn render(&mut self, cx: &mut ViewContext) -> Div { v_stack() .w_full() .h_full() diff --git a/crates/ui2/src/to_extract/language_selector.rs b/crates/ui2/src/to_extract/language_selector.rs index 46a10d5c88c923c19380a30647a17b7e56b427dd..694ca78e9c92353a7097f33d7ec133278b063bb0 100644 --- a/crates/ui2/src/to_extract/language_selector.rs +++ b/crates/ui2/src/to_extract/language_selector.rs @@ -40,12 +40,12 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct LanguageSelectorStory; impl Render for LanguageSelectorStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/multi_buffer.rs b/crates/ui2/src/to_extract/multi_buffer.rs index 0649bf12907aa51647a95e600304381abcf536fb..78a22d51d078bc6293e849f8898b53ee2c363109 100644 --- a/crates/ui2/src/to_extract/multi_buffer.rs +++ b/crates/ui2/src/to_extract/multi_buffer.rs @@ -40,12 +40,12 @@ pub use stories::*; mod stories { use super::*; use crate::{hello_world_rust_buffer_example, Story}; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct MultiBufferStory; impl Render for MultiBufferStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/notifications_panel.rs b/crates/ui2/src/to_extract/notifications_panel.rs index 0a85a15f34cd8bc1ec0725acae22452895f99b9c..a7854107b1c4f838f90a5042b50f065122a538f5 100644 --- a/crates/ui2/src/to_extract/notifications_panel.rs +++ b/crates/ui2/src/to_extract/notifications_panel.rs @@ -352,12 +352,12 @@ pub use stories::*; mod stories { use super::*; use crate::{Panel, Story}; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct NotificationsPanelStory; impl Render for NotificationsPanelStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/project_panel.rs b/crates/ui2/src/to_extract/project_panel.rs index c55056a7a90f0b3881075c7cf5fdb5b6ecd4a538..018f9a4bf10154504df580a1c95e31fe0a4a1016 100644 --- a/crates/ui2/src/to_extract/project_panel.rs +++ b/crates/ui2/src/to_extract/project_panel.rs @@ -55,12 +55,12 @@ pub use stories::*; mod stories { use super::*; use crate::{Panel, Story}; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct ProjectPanelStory; impl Render for ProjectPanelStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/recent_projects.rs b/crates/ui2/src/to_extract/recent_projects.rs index 83b15a31288568da49ad183a885a62fa5353f5a9..3d4f551490a47ef5eab616ebf1e2b1f6f0a0a726 100644 --- a/crates/ui2/src/to_extract/recent_projects.rs +++ b/crates/ui2/src/to_extract/recent_projects.rs @@ -36,12 +36,12 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct RecentProjectsStory; impl Render for RecentProjectsStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/tab_bar.rs b/crates/ui2/src/to_extract/tab_bar.rs index e8de2e9e58e3c0a29b97aba559c989e23684061f..3b4b5cc2205ebd015ba40b050d058384897be1e4 100644 --- a/crates/ui2/src/to_extract/tab_bar.rs +++ b/crates/ui2/src/to_extract/tab_bar.rs @@ -100,12 +100,12 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct TabBarStory; impl Render for TabBarStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/terminal.rs b/crates/ui2/src/to_extract/terminal.rs index 5bcbca4fde4ea1fc9d9a6184d0e01e14705594e8..6c36f35152d8082a3da7fda855a5fc58084b3ae2 100644 --- a/crates/ui2/src/to_extract/terminal.rs +++ b/crates/ui2/src/to_extract/terminal.rs @@ -83,11 +83,11 @@ pub use stories::*; mod stories { use super::*; use crate::Story; - use gpui::{Node, Render}; + use gpui::{Div, Render}; pub struct TerminalStory; impl Render for TerminalStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/theme_selector.rs b/crates/ui2/src/to_extract/theme_selector.rs index 7dd169a2f7a6a72c45642f7be41254c7c5727cbe..7f911b50bfa8d9b6273126053a7e791e41754989 100644 --- a/crates/ui2/src/to_extract/theme_selector.rs +++ b/crates/ui2/src/to_extract/theme_selector.rs @@ -39,7 +39,7 @@ pub use stories::*; #[cfg(feature = "stories")] mod stories { - use gpui::{Node, Render}; + use gpui::{Div, Render}; use crate::Story; @@ -48,7 +48,7 @@ mod stories { pub struct ThemeSelectorStory; impl Render for ThemeSelectorStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/title_bar.rs b/crates/ui2/src/to_extract/title_bar.rs index d805992023779e05c4c82d055bc59310c1dc0537..87d7dd4146d051aa5c8e4b8ae6697f487bfb34fa 100644 --- a/crates/ui2/src/to_extract/title_bar.rs +++ b/crates/ui2/src/to_extract/title_bar.rs @@ -1,7 +1,7 @@ use std::sync::atomic::AtomicBool; use std::sync::Arc; -use gpui::{Node, Render, View, VisualContext}; +use gpui::{Div, Render, View, VisualContext}; use crate::prelude::*; use crate::settings::user_settings; @@ -86,9 +86,9 @@ impl TitleBar { } impl Render for TitleBar { - type Element = Node; + type Element = Div; - fn render(&mut self, cx: &mut ViewContext) -> Node { + fn render(&mut self, cx: &mut ViewContext) -> Div { let settings = user_settings(cx); // let has_focus = cx.window_is_active(); @@ -202,9 +202,9 @@ mod stories { } impl Render for TitleBarStory { - type Element = Node; + type Element = Div; - fn render(&mut self, cx: &mut ViewContext) -> Node { + fn render(&mut self, cx: &mut ViewContext) -> Div { Story::container(cx) .child(Story::title_for::<_, TitleBar>(cx)) .child(Story::label(cx, "Default")) diff --git a/crates/ui2/src/to_extract/toolbar.rs b/crates/ui2/src/to_extract/toolbar.rs index 1c1795437b5fabba09978af2524fce7ba2f9fa06..81918f34a790b1ec91aa4ac33cad210972b191cf 100644 --- a/crates/ui2/src/to_extract/toolbar.rs +++ b/crates/ui2/src/to_extract/toolbar.rs @@ -73,7 +73,7 @@ mod stories { use std::path::PathBuf; use std::str::FromStr; - use gpui::{Node, Render}; + use gpui::{Div, Render}; use crate::{Breadcrumb, HighlightedText, Icon, IconButton, Story, Symbol}; @@ -82,7 +82,7 @@ mod stories { pub struct ToolbarStory; impl Render for ToolbarStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/traffic_lights.rs b/crates/ui2/src/to_extract/traffic_lights.rs index 76898eb19a08f58f195c1efa38fd36c33f7e1cff..245ff377f2146579f5532123a456f2f1ae498cfc 100644 --- a/crates/ui2/src/to_extract/traffic_lights.rs +++ b/crates/ui2/src/to_extract/traffic_lights.rs @@ -77,7 +77,7 @@ pub use stories::*; #[cfg(feature = "stories")] mod stories { - use gpui::{Node, Render}; + use gpui::{Div, Render}; use crate::Story; @@ -86,7 +86,7 @@ mod stories { pub struct TrafficLightsStory; impl Render for TrafficLightsStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { Story::container(cx) diff --git a/crates/ui2/src/to_extract/workspace.rs b/crates/ui2/src/to_extract/workspace.rs index 2ab6b4b3efd2f0d803ff6713f0d3787ec64c9de6..d6de8a828807606a6d55086af724983ca1a93df0 100644 --- a/crates/ui2/src/to_extract/workspace.rs +++ b/crates/ui2/src/to_extract/workspace.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use chrono::DateTime; -use gpui::{px, relative, Node, Render, Size, View, VisualContext}; +use gpui::{px, relative, Div, Render, Size, View, VisualContext}; use settings2::Settings; use theme2::ThemeSettings; @@ -192,9 +192,9 @@ impl Workspace { } impl Render for Workspace { - type Element = Node; + type Element = Div; - fn render(&mut self, cx: &mut ViewContext) -> Node { + fn render(&mut self, cx: &mut ViewContext) -> Div { let root_group = PaneGroup::new_panes( vec![Pane::new( "pane-0", @@ -388,7 +388,7 @@ mod stories { } impl Render for WorkspaceStory { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { div().child(self.workspace.clone()) diff --git a/crates/workspace2/src/dock.rs b/crates/workspace2/src/dock.rs index 0e507c0f7c214c80e83119feb93e40d251a01624..7695cffa882df33ae4ca37efcbaf98823dc7d962 100644 --- a/crates/workspace2/src/dock.rs +++ b/crates/workspace2/src/dock.rs @@ -1,6 +1,6 @@ use crate::{status_bar::StatusItemView, Axis, Workspace}; use gpui::{ - div, Action, AnyView, AppContext, Entity, EntityId, EventEmitter, Node, ParentComponent, + div, Action, AnyView, AppContext, Entity, EntityId, EventEmitter, Div, ParentComponent, Render, Subscription, View, ViewContext, WeakView, WindowContext, }; use schemars::JsonSchema; @@ -419,7 +419,7 @@ impl Dock { } impl Render for Dock { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { todo!() @@ -621,7 +621,7 @@ impl PanelButtons { // } impl Render for PanelButtons { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { // todo!() @@ -647,7 +647,7 @@ impl StatusItemView for PanelButtons { #[cfg(any(test, feature = "test-support"))] pub mod test { use super::*; - use gpui::{div, Node, ViewContext, WindowContext}; + use gpui::{div, Div, ViewContext, WindowContext}; pub struct TestPanel { pub position: DockPosition, @@ -672,7 +672,7 @@ pub mod test { } impl Render for TestPanel { - type Element = Node; + type Element = Div; fn render(&mut self, _cx: &mut ViewContext) -> Self::Element { div() diff --git a/crates/workspace2/src/modal_layer.rs b/crates/workspace2/src/modal_layer.rs index 6cc08d56a63ca776edda240a7ef611ea65f9a4ac..3ebb2749692ccb5401b5af26320e8f976a55c69f 100644 --- a/crates/workspace2/src/modal_layer.rs +++ b/crates/workspace2/src/modal_layer.rs @@ -1,5 +1,5 @@ use gpui::{ - div, prelude::*, px, AnyView, EventEmitter, FocusHandle, Node, Render, Subscription, View, + div, prelude::*, px, AnyView, EventEmitter, FocusHandle, Div, Render, Subscription, View, ViewContext, WindowContext, }; use ui::v_stack; @@ -76,7 +76,7 @@ impl ModalLayer { } impl Render for ModalLayer { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let Some(active_modal) = &self.active_modal else { diff --git a/crates/workspace2/src/notifications.rs b/crates/workspace2/src/notifications.rs index 8673645b1e5abd1349f6cf4b81ae14a654190d87..a17399af5754c249db7967417b2b8d73c06255b9 100644 --- a/crates/workspace2/src/notifications.rs +++ b/crates/workspace2/src/notifications.rs @@ -165,7 +165,7 @@ impl Workspace { pub mod simple_message_notification { use super::{Notification, NotificationEvent}; - use gpui::{AnyElement, AppContext, EventEmitter, Node, Render, TextStyle, ViewContext}; + use gpui::{AnyElement, AppContext, EventEmitter, Div, Render, TextStyle, ViewContext}; use serde::Deserialize; use std::{borrow::Cow, sync::Arc}; @@ -252,7 +252,7 @@ pub mod simple_message_notification { } impl Render for MessageNotification { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { todo!() diff --git a/crates/workspace2/src/pane.rs b/crates/workspace2/src/pane.rs index ff16ebdc6d7cb965483e77a8cd4bd10efad96c04..c4935599a60167b138194b0f3386d61e0f017763 100644 --- a/crates/workspace2/src/pane.rs +++ b/crates/workspace2/src/pane.rs @@ -8,7 +8,7 @@ use anyhow::Result; use collections::{HashMap, HashSet, VecDeque}; use gpui::{ actions, prelude::*, register_action, AppContext, AsyncWindowContext, Component, EntityId, - EventEmitter, FocusHandle, Model, Node, PromptLevel, Render, Task, View, ViewContext, + EventEmitter, FocusHandle, Model, Div, PromptLevel, Render, Task, View, ViewContext, VisualContext, WeakView, WindowContext, }; use parking_lot::Mutex; @@ -1901,7 +1901,7 @@ impl Pane { // } impl Render for Pane { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { v_stack() @@ -2926,7 +2926,7 @@ struct DraggedTab { } impl Render for DraggedTab { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { div().w_8().h_4().bg(gpui::red()) diff --git a/crates/workspace2/src/status_bar.rs b/crates/workspace2/src/status_bar.rs index 6ac524f8241e531726ead25db9d54a3dc03fdefd..18c6bbf0798eb0af6159ecf7914737b5fc291769 100644 --- a/crates/workspace2/src/status_bar.rs +++ b/crates/workspace2/src/status_bar.rs @@ -2,7 +2,7 @@ use std::any::TypeId; use crate::{ItemHandle, Pane}; use gpui::{ - div, AnyView, Component, Node, ParentComponent, Render, Styled, Subscription, View, + div, AnyView, Component, Div, ParentComponent, Render, Styled, Subscription, View, ViewContext, WindowContext, }; use theme2::ActiveTheme; @@ -34,7 +34,7 @@ pub struct StatusBar { } impl Render for StatusBar { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { div() diff --git a/crates/workspace2/src/toolbar.rs b/crates/workspace2/src/toolbar.rs index dfe661d5b01b937bf11a6932f9c1c50887f6f7a4..1d67da06b223155d076c39e53492ce370391aa06 100644 --- a/crates/workspace2/src/toolbar.rs +++ b/crates/workspace2/src/toolbar.rs @@ -1,6 +1,6 @@ use crate::ItemHandle; use gpui::{ - AnyView, Entity, EntityId, EventEmitter, Node, Render, View, ViewContext, WindowContext, + AnyView, Div, Entity, EntityId, EventEmitter, Render, View, ViewContext, WindowContext, }; pub enum ToolbarItemEvent { @@ -52,7 +52,7 @@ pub struct Toolbar { } impl Render for Toolbar { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { todo!() diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs index df2b1d8f30e4ca95b7786b572efa24c21b7becb6..10399624b58f180a57441f724a7e27e2e8383997 100644 --- a/crates/workspace2/src/workspace2.rs +++ b/crates/workspace2/src/workspace2.rs @@ -38,7 +38,7 @@ use futures::{ use gpui::{ actions, div, point, prelude::*, rems, size, Action, AnyModel, AnyView, AnyWeakView, AppContext, AsyncAppContext, AsyncWindowContext, Bounds, Component, Entity, EntityId, - EventEmitter, FocusHandle, GlobalPixels, KeyContext, Model, ModelContext, Node, + EventEmitter, FocusHandle, GlobalPixels, KeyContext, Model, ModelContext, Div, ParentComponent, Point, Render, Size, Styled, Subscription, Task, View, ViewContext, WeakView, WindowBounds, WindowContext, WindowHandle, WindowOptions, }; @@ -529,7 +529,7 @@ pub enum Event { pub struct Workspace { weak_self: WeakView, focus_handle: FocusHandle, - workspace_actions: Vec) -> Node>>, + workspace_actions: Vec) -> Div>>, zoomed: Option, zoomed_position: Option, center: PaneGroup, @@ -3503,7 +3503,7 @@ impl Workspace { })); } - fn add_workspace_actions_listeners(&self, mut div: Node) -> Node { + fn add_workspace_actions_listeners(&self, mut div: Div) -> Div { for action in self.workspace_actions.iter() { div = (action)(div) } @@ -3728,7 +3728,7 @@ fn notify_if_database_failed(workspace: WindowHandle, cx: &mut AsyncA impl EventEmitter for Workspace {} impl Render for Workspace { - type Element = Node; + type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let mut context = KeyContext::default();