Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Refactor command palette, picker and code action styles.
Nate Butler6bdb6e486e49
diff --git a/crates/command_palette2/src/command_palette.rs b/crates/command_palette2/src/command_palette.rsindex abba09519b1..0afbe50a03e 100644--- a/crates/command_palette2/src/command_palette.rs+++ b/crates/command_palette2/src/command_palette.rs@@ -8,7 +8,7 @@ use gpui::{use picker::{Picker, PickerDelegate};use std::cmp::{self, Reverse};use theme::ActiveTheme;-use ui::{modal, Label};+use ui::{modal, v_stack, Label};use util::{channel::{parse_zed_link, ReleaseChannel, RELEASE_CHANNEL},ResultExt,@@ -76,8 +76,8 @@ impl Modal for CommandPalette {impl Render for CommandPalette {type Element = Div<Self>;- fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {- modal(cx).w_96().child(self.picker.clone())+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> Self::Element {+ v_stack().w_96().child(self.picker.clone())}}diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rsindex 5bc67a57b61..27ec24b40b2 100644--- a/crates/editor2/src/editor.rs+++ b/crates/editor2/src/editor.rs@@ -97,7 +97,7 @@ use text::{OffsetUtf16, Rope};use theme::{ActiveTheme, DiagnosticStyle, PlayerColor, SyntaxTheme, Theme, ThemeColors, ThemeSettings,};-use ui::IconButton;+use ui::{IconButton, StyledExt};use util::{post_inc, RangeExt, ResultExt, TryFutureExt};use workspace::{item::ItemEvent, searchable::SearchEvent, ItemNavHistory, SplitDirection, ViewId, Workspace,@@ -1582,7 +1582,7 @@ impl CodeActionsMenu {.collect()},)- .bg(cx.theme().colors().element_background)+ .elevation_1(cx).px_2().py_1().with_width_from_item(diff --git a/crates/picker2/src/picker2.rs b/crates/picker2/src/picker2.rsindex 9d0019b2dc9..4d6e1788498 100644--- a/crates/picker2/src/picker2.rs+++ b/crates/picker2/src/picker2.rs@@ -5,8 +5,7 @@ use gpui::{WindowContext,};use std::cmp;-use theme::ActiveTheme;-use ui::v_stack;+use ui::{prelude::*, v_stack, Divider};pub struct Picker<D: PickerDelegate> {pub delegate: D,@@ -145,6 +144,7 @@ impl<D: PickerDelegate> Render for Picker<D> {.id("picker-container").focusable().size_full()+ .elevation_2(cx).on_action(Self::select_next).on_action(Self::select_prev).on_action(Self::select_first)@@ -153,19 +153,12 @@ impl<D: PickerDelegate> Render for Picker<D> {.on_action(Self::confirm).on_action(Self::secondary_confirm).child(- v_stack().gap_px().child(- v_stack()- .py_0p5()- .px_1()- .child(div().px_2().py_0p5().child(self.editor.clone())),- ),- )- .child(- div()- .h_px()- .w_full()- .bg(cx.theme().colors().element_background),+ v_stack()+ .py_0p5()+ .px_1()+ .child(div().px_2().py_0p5().child(self.editor.clone())),)+ .child(Divider::horizontal()).child(v_stack().py_0p5()