Update pickers (#3529)

[[PR Description]]

- Update the size of all pickers
- Additional styling fixes for File Finder and Outline palettes
- Extend the ui prelude to include common imports

Release Notes:

- N/A
This commit is contained in:
Nate Butler 2023-12-07 00:24:46 -05:00 committed by GitHub
commit 42a3da4ba3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 122 additions and 45 deletions

View file

@ -1,7 +1,8 @@
pub use gpui::prelude::*;
pub use gpui::{
div, Element, ElementId, InteractiveElement, ParentElement, RenderOnce, SharedString, Styled,
ViewContext, WindowContext,
div, px, relative, rems, AbsoluteLength, DefiniteLength, Div, Element, ElementId,
InteractiveElement, ParentElement, Pixels, Rems, RenderOnce, SharedString, Styled, ViewContext,
WindowContext,
};
pub use crate::clickable::*;
@ -9,5 +10,8 @@ pub use crate::disableable::*;
pub use crate::fixed::*;
pub use crate::selectable::*;
pub use crate::{h_stack, v_stack};
pub use crate::{ButtonCommon, Color, LabelCommon, StyledExt};
pub use crate::{Button, ButtonSize, ButtonStyle, IconButton};
pub use crate::{ButtonCommon, Color, StyledExt};
pub use crate::{Icon, IconElement, IconSize};
pub use crate::{Label, LabelCommon, LabelSize, LineHeightStyle};
pub use theme::ActiveTheme;

View file

@ -1,4 +1,4 @@
use gpui::{px, Styled, WindowContext};
use gpui::{hsla, px, Styled, WindowContext};
use settings::Settings;
use theme::ThemeSettings;
@ -103,6 +103,30 @@ pub trait StyledExt: Styled + Sized {
fn elevation_3(self, cx: &mut WindowContext) -> Self {
elevated(self, cx, ElevationIndex::ModalSurface)
}
fn debug_bg_red(self) -> Self {
self.bg(gpui::red())
}
fn debug_bg_green(self) -> Self {
self.bg(gpui::green())
}
fn debug_bg_blue(self) -> Self {
self.bg(gpui::blue())
}
fn debug_bg_yellow(self) -> Self {
self.bg(hsla(60. / 360., 1., 0.5, 1.))
}
fn debug_bg_cyan(self) -> Self {
self.bg(hsla(160. / 360., 1., 0.5, 1.))
}
fn debug_bg_magenta(self) -> Self {
self.bg(hsla(300. / 360., 1., 0.5, 1.))
}
}
impl<E: Styled> StyledExt for E {}

View file

@ -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.),
},