Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
ui: Remove `ToolStrip` component (#24529)
Marshall Bowers072d2b061ab8
diff --git a/crates/storybook/src/story_selector.rs b/crates/storybook/src/story_selector.rsindex f9af57f8b52..6f844a65b58 100644--- a/crates/storybook/src/story_selector.rs+++ b/crates/storybook/src/story_selector.rs@@ -36,7 +36,6 @@ pub enum ComponentStory {TabBar,Text,ToggleButton,- ToolStrip,ViewportUnits,WithRemSize,Vector,@@ -73,7 +72,6 @@ impl ComponentStory {Self::TabBar => cx.new(|_| ui::TabBarStory).into(),Self::Text => TextStory::model(cx).into(),Self::ToggleButton => cx.new(|_| ui::ToggleButtonStory).into(),- Self::ToolStrip => cx.new(|_| ui::ToolStripStory).into(),Self::ViewportUnits => cx.new(|_| crate::stories::ViewportUnitsStory).into(),Self::WithRemSize => cx.new(|_| crate::stories::WithRemSizeStory).into(),Self::Vector => cx.new(|_| ui::VectorStory).into(),diff --git a/crates/ui/src/components.rs b/crates/ui/src/components.rsindex 94ace5632c6..184d841bb1c 100644--- a/crates/ui/src/components.rs+++ b/crates/ui/src/components.rs@@ -29,7 +29,6 @@ mod tab;mod tab_bar;mod table;mod toggle;-mod tool_strip;mod tooltip;#[cfg(feature = "stories")]@@ -66,7 +65,6 @@ pub use tab::*;pub use tab_bar::*;pub use table::*;pub use toggle::*;-pub use tool_strip::*;pub use tooltip::*;#[cfg(feature = "stories")]diff --git a/crates/ui/src/components/stories.rs b/crates/ui/src/components/stories.rsindex b55aa064f92..9161b14b47d 100644--- a/crates/ui/src/components/stories.rs+++ b/crates/ui/src/components/stories.rs@@ -15,7 +15,6 @@ mod list_item;mod tab;mod tab_bar;mod toggle_button;-mod tool_strip;pub use avatar::*;pub use button::*;@@ -31,4 +30,3 @@ pub use list_item::*;pub use tab::*;pub use tab_bar::*;pub use toggle_button::*;-pub use tool_strip::*;diff --git a/crates/ui/src/components/stories/tool_strip.rs b/crates/ui/src/components/stories/tool_strip.rsdeleted file mode 100644index 0a6a6b7ad03..00000000000--- a/crates/ui/src/components/stories/tool_strip.rs+++ /dev/null@@ -1,33 +0,0 @@-use gpui::Render;-use story::{Story, StoryItem, StorySection};--use crate::{prelude::*, ToolStrip, Tooltip};--pub struct ToolStripStory;--impl Render for ToolStripStory {- fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {- Story::container()- .child(Story::title_for::<ToolStrip>())- .child(- StorySection::new().child(StoryItem::new(- "Vertical Tool Strip",- h_flex().child(- ToolStrip::vertical("tool_strip_example")- .tool(- IconButton::new("example_tool", IconName::AudioOn)- .tooltip(Tooltip::text("Example tool")),- )- .tool(- IconButton::new("example_tool_2", IconName::MicMute)- .tooltip(Tooltip::text("Example tool 2")),- )- .tool(- IconButton::new("example_tool_3", IconName::Screen)- .tooltip(Tooltip::text("Example tool 3")),- ),- ),- )),- )- }-}diff --git a/crates/ui/src/components/tool_strip.rs b/crates/ui/src/components/tool_strip.rsdeleted file mode 100644index 00166c8d7ef..00000000000--- a/crates/ui/src/components/tool_strip.rs+++ /dev/null@@ -1,58 +0,0 @@-#![allow(missing_docs)]--use gpui::Axis;--use crate::prelude::*;--#[derive(IntoElement)]-pub struct ToolStrip {- id: ElementId,- tools: Vec<IconButton>,- axis: Axis,-}--impl ToolStrip {- fn new(id: ElementId, axis: Axis) -> Self {- Self {- id,- tools: vec![],- axis,- }- }-- pub fn vertical(id: impl Into<ElementId>) -> Self {- Self::new(id.into(), Axis::Vertical)- }-- pub fn tools(mut self, tools: Vec<IconButton>) -> Self {- self.tools = tools;- self- }-- pub fn tool(mut self, tool: IconButton) -> Self {- self.tools.push(tool);- self- }-}--impl RenderOnce for ToolStrip {- fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {- let group = format!("tool_strip_{}", self.id.clone());-- div()- .id(self.id.clone())- .group(group)- .map(|element| match self.axis {- Axis::Vertical => element.v_flex(),- Axis::Horizontal => element.h_flex(),- })- .flex_none()- .gap(DynamicSpacing::Base04.rems(cx))- .p(DynamicSpacing::Base02.rems(cx))- .border_1()- .border_color(cx.theme().colors().border)- .rounded(rems_from_px(6.0))- .bg(cx.theme().colors().elevated_surface_background)- .children(self.tools)- }-}