diff --git a/crates/file_finder2/src/file_finder.rs b/crates/file_finder2/src/file_finder.rs index 9938b94edb2892d15f547e95df6ee3192f0f992b..0a11b13fb9b040ea1a3fca398d681da14551476d 100644 --- a/crates/file_finder2/src/file_finder.rs +++ b/crates/file_finder2/src/file_finder.rs @@ -720,7 +720,9 @@ impl PickerDelegate for FileFinderDelegate { ListItem::new(ix).inset(true).selected(selected).child( v_stack() .child(HighlightedLabel::new(file_name, file_name_positions)) - .child(HighlightedLabel::new(full_path, full_path_positions)), + .child( + HighlightedLabel::new(full_path, full_path_positions).color(Color::Muted), + ), ), ) } diff --git a/crates/picker2/src/picker2.rs b/crates/picker2/src/picker2.rs index 89513be8b38b49f973dd7430d16c532405711071..54df321cb1202dfac32f9663ac40fb5c84a2f745 100644 --- a/crates/picker2/src/picker2.rs +++ b/crates/picker2/src/picker2.rs @@ -1,6 +1,6 @@ use editor::Editor; use gpui::{ - div, prelude::*, uniform_list, AnyElement, AppContext, Div, FocusHandle, FocusableView, + div, prelude::*, rems, uniform_list, AnyElement, AppContext, Div, FocusHandle, FocusableView, MouseButton, MouseDownEvent, Render, Task, UniformListScrollHandle, View, ViewContext, WindowContext, }; @@ -193,10 +193,27 @@ impl Render for Picker { type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { + let picker_editor = h_stack() + .overflow_hidden() + .flex_none() + .h_9() + .px_3() + .child(self.editor.clone()); + + let empty_state = div().p_1().child( + h_stack() + // TODO: This number matches the height of the uniform list items. + // Align these two with a less magic number. + .h(rems(1.4375)) + .px_2() + .child(Label::new("No matches").color(Color::Muted)), + ); + div() .key_context("picker") .size_full() - .elevation_2(cx) + .overflow_hidden() + .elevation_3(cx) .on_action(cx.listener(Self::select_next)) .on_action(cx.listener(Self::select_prev)) .on_action(cx.listener(Self::select_first)) @@ -205,10 +222,7 @@ impl Render for Picker { .on_action(cx.listener(Self::confirm)) .on_action(cx.listener(Self::secondary_confirm)) .child( - v_stack() - .py_0p5() - .px_1() - .child(div().px_1().py_0p5().child(self.editor.clone())), + picker_editor ) .child(Divider::horizontal()) .when(self.delegate.match_count() > 0, |el| { @@ -256,11 +270,7 @@ impl Render for Picker { }) .when(self.delegate.match_count() == 0, |el| { el.child( - v_stack().p_1().grow().child( - div() - .px_1() - .child(Label::new("No matches").color(Color::Muted)), - ), + empty_state ) }) } diff --git a/crates/ui2/src/styles/elevation.rs b/crates/ui2/src/styles/elevation.rs index 198d41e6b8857826d82e8b46a3582aebe8cf9efc..88b2ff2e56aeaf5d2e212fca7218afa3940a4742 100644 --- a/crates/ui2/src/styles/elevation.rs +++ b/crates/ui2/src/styles/elevation.rs @@ -37,7 +37,7 @@ impl ElevationIndex { ElevationIndex::ElevatedSurface => smallvec![BoxShadow { color: hsla(0., 0., 0., 0.12), - offset: point(px(0.), px(1.)), + offset: point(px(0.), px(2.)), blur_radius: px(3.), spread_radius: px(0.), }], @@ -45,13 +45,19 @@ impl ElevationIndex { ElevationIndex::ModalSurface => smallvec![ BoxShadow { color: hsla(0., 0., 0., 0.12), - offset: point(px(0.), px(1.)), + offset: point(px(0.), px(2.)), blur_radius: px(3.), spread_radius: px(0.), }, BoxShadow { - color: hsla(0., 0., 0., 0.20), - offset: point(px(3.), px(1.)), + color: hsla(0., 0., 0., 0.08), + offset: point(px(0.), px(3.)), + blur_radius: px(6.), + spread_radius: px(0.), + }, + BoxShadow { + color: hsla(0., 0., 0., 0.04), + offset: point(px(0.), px(6.)), blur_radius: px(12.), spread_radius: px(0.), },