From e0050c5ebedc4778215424930b8a24a70dea3586 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Fri, 28 Jun 2024 10:09:50 +0800 Subject: [PATCH] Fix light theme --- crates/ui-story/src/picker_story.rs | 20 +++++++++++--------- crates/ui/src/picker.rs | 2 -- crates/ui/src/styled_ext.rs | 3 --- crates/ui/src/theme.rs | 2 +- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/crates/ui-story/src/picker_story.rs b/crates/ui-story/src/picker_story.rs index a7e6ec4b..60c8ef63 100644 --- a/crates/ui-story/src/picker_story.rs +++ b/crates/ui-story/src/picker_story.rs @@ -5,7 +5,7 @@ use gpui::{ }; use ui::{ - button::Button, + button::{Button, ButtonStyle}, h_flex, label::Label, list::ListItem, @@ -195,14 +195,16 @@ impl PickerStory { impl Render for PickerStory { fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { story_case("Picker", "Picker is a list of items that can be selected.") - .child(v_flex().items_start().child( - Button::new("show-picker", "Show Picker...").on_click(cx.listener( - |this, _, cx| { - this.open = !this.open; - cx.notify(); - }, - )), - )) + .child( + v_flex().items_start().child( + Button::new("show-picker", "Show Picker...") + .style(ButtonStyle::Primary) + .on_click(cx.listener(|this, _, cx| { + this.open = !this.open; + cx.notify(); + })), + ), + ) .when_some(self.selected_value.clone(), |this, selected_value| { this.child("Selected: ").child(Label::new(selected_value)) }) diff --git a/crates/ui/src/picker.rs b/crates/ui/src/picker.rs index 2a2b8687..814a5fce 100644 --- a/crates/ui/src/picker.rs +++ b/crates/ui/src/picker.rs @@ -262,13 +262,11 @@ impl Picker { ) .with_sizing_behavior(sizing_behavior) .flex_grow() - .py_2() .track_scroll(scroll_handle.clone()) .into_any_element(), ElementContainer::List(state) => list(state.clone()) .with_sizing_behavior(sizing_behavior) .flex_grow() - .py_2() .into_any_element(), } } diff --git a/crates/ui/src/styled_ext.rs b/crates/ui/src/styled_ext.rs index 9c3e0c4e..f6b57fc9 100644 --- a/crates/ui/src/styled_ext.rs +++ b/crates/ui/src/styled_ext.rs @@ -3,12 +3,9 @@ use gpui::{hsla, point, px, BoxShadow, Styled, WindowContext}; use smallvec::{smallvec, SmallVec}; pub enum ElevationIndex { - Background, Surface, ElevatedSurface, - Wash, ModalSurface, - DraggedElement, } impl ElevationIndex { diff --git a/crates/ui/src/theme.rs b/crates/ui/src/theme.rs index 41e1fd53..5bc6c3b6 100644 --- a/crates/ui/src/theme.rs +++ b/crates/ui/src/theme.rs @@ -127,7 +127,7 @@ impl Colors { foreground: hsl(240.0, 10., 3.9), card: hsl(0.0, 0.0, 100.0), card_foreground: hsl(240.0, 10.0, 3.9), - popover: hsl(0.0, 0.0, 1.0), + popover: hsl(0.0, 0.0, 100.0), popover_foreground: hsl(240.0, 10.0, 3.9), primary: hsl(240.0, 5.9, 10.0), primary_foreground: hsl(0.0, 0.0, 98.0),