Refine project panel, list

This commit is contained in:
Nate Butler 2023-10-11 12:22:24 -04:00
parent b6a9c58994
commit 0d8c743dfe
7 changed files with 199 additions and 185 deletions

View file

@ -5,9 +5,32 @@ pub use gpui3::{
pub use crate::{theme, ButtonVariant, ElementExt, HackyChildren, HackyChildrenPayload, Theme};
use gpui3::{hsla, rgb, Hsla};
use gpui3::{hsla, rems, rgb, AbsoluteLength, Hsla};
use strum::EnumIter;
#[derive(Clone, Copy)]
pub struct Token {
pub list_indent_depth: AbsoluteLength,
pub default_panel_size: AbsoluteLength,
pub state_hover_background: Hsla,
pub state_active_background: Hsla,
}
impl Default for Token {
fn default() -> Self {
Self {
list_indent_depth: AbsoluteLength::Rems(rems(0.3)),
default_panel_size: AbsoluteLength::Rems(rems(16.)),
state_hover_background: hsla(0.0, 0.0, 0.0, 0.08),
state_active_background: hsla(0.0, 0.0, 0.0, 0.16),
}
}
}
pub fn token() -> Token {
Token::default()
}
#[derive(Default)]
pub struct SystemColor {
pub transparent: Hsla,
@ -34,8 +57,10 @@ impl SystemColor {
pub struct ThemeColor {
pub border: Hsla,
pub border_variant: Hsla,
pub border_focused: Hsla,
/// The background color of an elevated surface, like a modal, tooltip or toast.
pub elevated_surface: Hsla,
pub panel_surface: Hsla,
}
impl ThemeColor {
@ -45,7 +70,9 @@ impl ThemeColor {
Self {
border: theme.lowest.base.default.border,
border_variant: theme.lowest.variant.default.border,
border_focused: theme.lowest.accent.default.border,
elevated_surface: theme.middle.base.default.background,
panel_surface: theme.middle.base.default.background,
}
}
}