This commit is contained in:
2026-10-08 08:51:11 +07:00
parent 2efb6ac5ca
commit f4b435b160
48 changed files with 211 additions and 222 deletions
+33 -33
View File
@@ -904,7 +904,7 @@ impl ChatPanel {
.h_10() .h_10()
.justify_center() .justify_center()
.text_sm() .text_sm()
.bg(cx.theme().elevated_surface_background) .bg(cx.theme().raised)
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.child("Message isn't traced yet"), .child("Message isn't traced yet"),
) )
@@ -919,7 +919,7 @@ impl ChatPanel {
.h_7() .h_7()
.px_2() .px_2()
.gap_2() .gap_2()
.bg(cx.theme().elevated_surface_background) .bg(cx.theme().raised)
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.text_sm() .text_sm()
.child(div().size_1p5().rounded_full().bg(gpui::green())) .child(div().size_1p5().rounded_full().bg(gpui::green()))
@@ -951,7 +951,7 @@ impl ChatPanel {
.h_7() .h_7()
.px_2() .px_2()
.gap_2() .gap_2()
.bg(cx.theme().elevated_surface_background) .bg(cx.theme().raised)
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.text_sm() .text_sm()
.child(div().size_1p5().rounded_full().bg(gpui::green())) .child(div().size_1p5().rounded_full().bg(gpui::green()))
@@ -975,7 +975,7 @@ impl ChatPanel {
svg() svg()
.path("brand/coop.svg") .path("brand/coop.svg")
.size_12() .size_12()
.text_color(cx.theme().ghost_element_background_alt), .text_color(cx.theme().raised),
) )
.message(PRIVATE_NOTICE) .message(PRIVATE_NOTICE)
.into_any_element() .into_any_element()
@@ -991,13 +991,13 @@ impl ChatPanel {
.justify_center() .justify_center()
.text_center() .text_center()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.line_height(relative(1.3)) .line_height(relative(1.3))
.child( .child(
svg() svg()
.path("brand/coop.svg") .path("brand/coop.svg")
.size_12() .size_12()
.text_color(cx.theme().ghost_element_active), .text_color(cx.theme().active),
) )
.child(PRIVATE_NOTICE) .child(PRIVATE_NOTICE)
.into_any_element() .into_any_element()
@@ -1020,8 +1020,8 @@ impl ChatPanel {
.size_8() .size_8()
.justify_center() .justify_center()
.rounded_full() .rounded_full()
.bg(cx.theme().warning_background) .bg(cx.theme().warning_muted)
.text_color(cx.theme().warning_foreground) .text_color(cx.theme().warning)
.child(Icon::new(IconName::Warning).small()), .child(Icon::new(IconName::Warning).small()),
) )
.child( .child(
@@ -1155,13 +1155,13 @@ impl ChatPanel {
}) })
.overlay( .overlay(
div() div()
.group_hover("", |this| this.bg(cx.theme().element_active)) .group_hover("", |this| this.bg(cx.theme().hover))
.absolute() .absolute()
.left_0() .left_0()
.top_0() .top_0()
.w(px(2.)) .w(px(2.))
.h_full() .h_full()
.bg(cx.theme().border_transparent), .bg(gpui::transparent_black()),
) )
.overlay(self.render_actions(&id, &pk, cx)) .overlay(self.render_actions(&id, &pk, cx))
.on_mouse_down( .on_mouse_down(
@@ -1187,7 +1187,7 @@ impl ChatPanel {
return div().child( return div().child(
img(media[0].clone()) img(media[0].clone())
.border_1() .border_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.h(px(250.)) .h(px(250.))
.object_fit(ObjectFit::Cover) .object_fit(ObjectFit::Cover)
.rounded(cx.theme().radius), .rounded(cx.theme().radius),
@@ -1215,7 +1215,7 @@ impl ChatPanel {
img(item.clone()) img(item.clone())
.h_32() .h_32()
.border_1() .border_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.rounded(cx.theme().radius), .rounded(cx.theme().radius),
), ),
); );
@@ -1244,7 +1244,7 @@ impl ChatPanel {
.w_full() .w_full()
.px_2() .px_2()
.border_l_2() .border_l_2()
.border_color(cx.theme().element_active) .border_color(cx.theme().accent.active)
.text_sm() .text_sm()
.child(div().font_semibold().child(author.name())) .child(div().font_semibold().child(author.name()))
.child( .child(
@@ -1254,7 +1254,7 @@ impl ChatPanel {
.line_clamp(1) .line_clamp(1)
.child(message.preview()), .child(message.preview()),
) )
.hover(|this| this.bg(cx.theme().elevated_surface_background)) .hover(|this| this.bg(cx.theme().hover))
.on_click({ .on_click({
let id = *id; let id = *id;
cx.listener(move |this, _event, _window, _cx| { cx.listener(move |this, _event, _window, _cx| {
@@ -1294,9 +1294,9 @@ impl ChatPanel {
.text_xs() .text_xs()
.border_1() .border_1()
.when(has_reacted, |this| { .when(has_reacted, |this| {
this.text_color(cx.theme().secondary_foreground) this.text_color(cx.theme().accent.text_on_wash)
.bg(cx.theme().secondary_background) .bg(cx.theme().accent.wash)
.border_color(cx.theme().secondary_active) .border_color(cx.theme().accent.selection)
}) })
.when(!has_reacted, |this| this.border_color(cx.theme().border)) .when(!has_reacted, |this| this.border_color(cx.theme().border))
.child(emoji) .child(emoji)
@@ -1330,7 +1330,7 @@ impl ChatPanel {
div() div()
.id(SharedString::from(id.to_hex())) .id(SharedString::from(id.to_hex()))
.child(label) .child(label)
.when(failed, |this| this.text_color(cx.theme().text_danger)) .when(failed, |this| this.text_color(cx.theme().danger))
.when_some(reports, |this, reports| { .when_some(reports, |this, reports| {
this.when(!pending, |this| { this.when(!pending, |this| {
this.on_click(move |_e, window, cx| { this.on_click(move |_e, window, cx| {
@@ -1386,8 +1386,8 @@ impl ChatPanel {
.w_full() .w_full()
.text_sm() .text_sm()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().warning_background) .bg(cx.theme().warning_muted)
.text_color(cx.theme().warning_foreground) .text_color(cx.theme().warning)
.child(div().flex_1().w_full().text_center().child(error)), .child(div().flex_1().w_full().text_center().child(error)),
) )
}) })
@@ -1406,7 +1406,7 @@ impl ChatPanel {
.p_1() .p_1()
.w_full() .w_full()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().danger_background) .bg(cx.theme().danger_muted)
.child( .child(
div() div()
.text_xs() .text_xs()
@@ -1417,7 +1417,7 @@ impl ChatPanel {
.child( .child(
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().danger_foreground) .text_color(cx.theme().danger)
.line_height(relative(1.25)) .line_height(relative(1.25))
.child(SharedString::from(msg.to_string())), .child(SharedString::from(msg.to_string())),
), ),
@@ -1436,7 +1436,7 @@ impl ChatPanel {
.p_1() .p_1()
.w_full() .w_full()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().elevated_surface_background) .bg(cx.theme().raised)
.child( .child(
div() div()
.text_xs() .text_xs()
@@ -1611,7 +1611,7 @@ impl ChatPanel {
.child( .child(
img(path.clone()) img(path.clone())
.border_1() .border_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.h(px(250.)) .h(px(250.))
.object_fit(ObjectFit::Cover) .object_fit(ObjectFit::Cover)
.rounded(cx.theme().radius), .rounded(cx.theme().radius),
@@ -1645,9 +1645,9 @@ impl ChatPanel {
.gap_2() .gap_2()
.p_2() .p_2()
.border_1() .border_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.child(Icon::new(IconName::Lock).text_color(cx.theme().icon_accent)) .child(Icon::new(IconName::Lock).text_color(cx.theme().accent.primary))
.child( .child(
v_flex() v_flex()
.min_w_0() .min_w_0()
@@ -1657,7 +1657,7 @@ impl ChatPanel {
.child( .child(
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(label), .child(label),
), ),
) )
@@ -1700,8 +1700,8 @@ impl ChatPanel {
.justify_center() .justify_center()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.border_1() .border_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.text_xs() .text_xs()
.text_center() .text_center()
.child("Preview not available"), .child("Preview not available"),
@@ -1718,7 +1718,7 @@ impl ChatPanel {
.justify_center() .justify_center()
.rounded_full() .rounded_full()
.border_1() .border_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.bg(gpui::green()) .bg(gpui::green())
.child(Icon::new(IconName::Lock).size_2().text_color(gpui::white())), .child(Icon::new(IconName::Lock).size_2().text_color(gpui::white())),
) )
@@ -1753,7 +1753,7 @@ impl ChatPanel {
.w_full() .w_full()
.pl_2() .pl_2()
.border_l_2() .border_l_2()
.border_color(cx.theme().element_active) .border_color(cx.theme().accent.active)
.child( .child(
div() div()
.flex() .flex()
@@ -1769,7 +1769,7 @@ impl ChatPanel {
.child("Replying to:") .child("Replying to:")
.child( .child(
div() div()
.text_color(cx.theme().text_accent) .text_color(cx.theme().accent.primary)
.child(profile.name()), .child(profile.name()),
), ),
) )
@@ -1994,7 +1994,7 @@ impl Render for ChatPanel {
div() div()
.px_1() .px_1()
.text_xs() .text_xs()
.text_color(cx.theme().text_warning) .text_color(cx.theme().warning)
.child(WARNING), .child(WARNING),
) )
}) })
+3 -3
View File
@@ -78,7 +78,7 @@ fn body(group: &WeakEntity<Group>, cx: &App) -> AnyElement {
"Supported kinds", "Supported kinds",
if items.is_empty() { if items.is_empty() {
div() div()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child("None") .child("None")
.into_any_element() .into_any_element()
} else { } else {
@@ -175,7 +175,7 @@ fn header(group: &Group, cx: &App) -> AnyElement {
.child( .child(
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.truncate() .truncate()
.child(SharedString::from(format!( .child(SharedString::from(format!(
"{} · {}", "{} · {}",
@@ -239,7 +239,7 @@ fn chip(label: impl Into<SharedString>, cx: &App) -> AnyElement {
.px_1p5() .px_1p5()
.py_0p5() .py_0p5()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().element_background) .bg(cx.theme().accent.wash)
.text_xs() .text_xs()
.child(label.into()) .child(label.into())
.into_any_element() .into_any_element()
+4 -4
View File
@@ -622,7 +622,7 @@ impl GroupPanel {
.child( .child(
Icon::new(IconName::Info) Icon::new(IconName::Info)
.small() .small()
.text_color(cx.theme().icon_muted), .text_color(cx.theme().text_faint),
) )
.child(div().flex_1().min_w_0().truncate().child(message)) .child(div().flex_1().min_w_0().truncate().child(message))
.child( .child(
@@ -662,7 +662,7 @@ impl GroupPanel {
.px_1p5() .px_1p5()
.py_0p5() .py_0p5()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().element_background) .bg(cx.theme().accent.wash)
.text_xs() .text_xs()
.text_color(cx.theme().text_muted) .text_color(cx.theme().text_muted)
.child(pin_label(group, pin)) .child(pin_label(group, pin))
@@ -924,7 +924,7 @@ impl GroupPanel {
.h_8() .h_8()
.px_2() .px_2()
.border_1() .border_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.text_xs() .text_xs()
.text_color(cx.theme().text_muted) .text_color(cx.theme().text_muted)
@@ -1034,7 +1034,7 @@ impl Render for GroupPanel {
.size_full() .size_full()
.justify_center() .justify_center()
.text_sm() .text_sm()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child("No messages yet") .child("No messages yet")
.into_any_element(), .into_any_element(),
}), }),
+10 -10
View File
@@ -141,7 +141,7 @@ pub(crate) fn render_activity(ix: usize, activity: &Activity, cx: &App) -> AnyEl
.gap_2() .gap_2()
.py_1() .py_1()
.px_3() .px_3()
.hover(|this| this.bg(cx.theme().surface_background)) .hover(|this| this.bg(cx.theme().hover))
.child(badge(activity, cx)) .child(badge(activity, cx))
.when(!hide_avatar, |this| { .when(!hide_avatar, |this| {
this.child( this.child(
@@ -164,7 +164,7 @@ pub(crate) fn render_activity(ix: usize, activity: &Activity, cx: &App) -> AnyEl
.min_w_0() .min_w_0()
.truncate() .truncate()
.text_sm() .text_sm()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(SharedString::from(action(activity))), .child(SharedString::from(action(activity))),
) )
.child( .child(
@@ -172,7 +172,7 @@ pub(crate) fn render_activity(ix: usize, activity: &Activity, cx: &App) -> AnyEl
.flex_shrink_0() .flex_shrink_0()
.ml_1() .ml_1()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(activity.created_at.to_ago()), .child(activity.created_at.to_ago()),
) )
.into_any_element() .into_any_element()
@@ -180,11 +180,11 @@ pub(crate) fn render_activity(ix: usize, activity: &Activity, cx: &App) -> AnyEl
fn badge(activity: &Activity, cx: &App) -> AnyElement { fn badge(activity: &Activity, cx: &App) -> AnyElement {
let (icon, color) = match activity.kind { let (icon, color) = match activity.kind {
Kind::GroupJoinRequest => (IconName::Login, cx.theme().icon_accent), Kind::GroupJoinRequest => (IconName::Login, cx.theme().accent.primary),
Kind::GroupPutUser => (IconName::Login, cx.theme().icon_accent), Kind::GroupPutUser => (IconName::Login, cx.theme().accent.primary),
Kind::GroupLeaveRequest => (IconName::Logout, cx.theme().text_danger), Kind::GroupLeaveRequest => (IconName::Logout, cx.theme().danger),
Kind::GroupRemoveUser => (IconName::Ban, cx.theme().text_danger), Kind::GroupRemoveUser => (IconName::Ban, cx.theme().danger),
_ => (IconName::Info, cx.theme().icon_muted), _ => (IconName::Info, cx.theme().text_faint),
}; };
h_flex() h_flex()
@@ -211,7 +211,7 @@ fn media(media: &[SharedUri], cx: &App) -> AnyElement {
.child( .child(
img(only.clone()) img(only.clone())
.border_1() .border_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.h(px(250.)) .h(px(250.))
.object_fit(ObjectFit::Cover) .object_fit(ObjectFit::Cover)
.rounded(cx.theme().radius), .rounded(cx.theme().radius),
@@ -231,7 +231,7 @@ fn media(media: &[SharedUri], cx: &App) -> AnyElement {
img(item.clone()) img(item.clone())
.h_32() .h_32()
.border_1() .border_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.rounded(cx.theme().radius), .rounded(cx.theme().radius),
) )
})) }))
+2 -2
View File
@@ -748,7 +748,7 @@ impl DeviceRegistry {
.w_full() .w_full()
.px_2() .px_2()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().elevated_surface_background) .bg(cx.theme().raised)
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
@@ -778,7 +778,7 @@ impl DeviceRegistry {
.w_full() .w_full()
.px_2() .px_2()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().elevated_surface_background) .bg(cx.theme().raised)
.child(code_label.clone()), .child(code_label.clone()),
), ),
), ),
+2 -2
View File
@@ -424,7 +424,7 @@ impl InteractiveElement for Avatar {
} }
impl RenderOnce for Avatar { impl RenderOnce for Avatar {
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement { fn render(self, window: &mut Window, _cx: &mut App) -> impl IntoElement {
let border_width = if self.border_color.is_some() { let border_width = if self.border_color.is_some() {
px(2.) px(2.)
} else { } else {
@@ -444,7 +444,7 @@ impl RenderOnce for Avatar {
.rounded_full() .rounded_full()
.object_fit(ObjectFit::Cover) .object_fit(ObjectFit::Cover)
.grayscale(grayscale) .grayscale(grayscale)
.bg(cx.theme().ghost_element_background) .bg(gpui::transparent_black())
.with_fallback(move || generated_avatar(seed.as_deref(), image_size)) .with_fallback(move || generated_avatar(seed.as_deref(), image_size))
.into_any_element() .into_any_element()
} }
+41 -41
View File
@@ -24,10 +24,10 @@ pub struct ButtonCustomVariant {
impl ButtonCustomVariant { impl ButtonCustomVariant {
pub fn new(_window: &Window, cx: &App) -> Self { pub fn new(_window: &Window, cx: &App) -> Self {
Self { Self {
color: cx.theme().element_background, color: cx.theme().accent.primary,
foreground: cx.theme().element_foreground, foreground: cx.theme().accent.on,
hover: cx.theme().element_hover, hover: cx.theme().accent.hover,
active: cx.theme().element_active, active: cx.theme().accent.active,
} }
} }
@@ -470,15 +470,15 @@ impl ButtonVariant {
fn bg_color(&self, cx: &App) -> Hsla { fn bg_color(&self, cx: &App) -> Hsla {
match self { match self {
ButtonVariant::Primary => cx.theme().element_background, ButtonVariant::Primary => cx.theme().accent.primary,
ButtonVariant::Secondary => cx.theme().secondary_background, ButtonVariant::Secondary => cx.theme().accent.wash,
ButtonVariant::Danger => cx.theme().danger_background, ButtonVariant::Danger => cx.theme().danger,
ButtonVariant::Warning => cx.theme().warning_background, ButtonVariant::Warning => cx.theme().warning,
ButtonVariant::Ghost { alt } => { ButtonVariant::Ghost { alt } => {
if *alt { if *alt {
cx.theme().ghost_element_background_alt cx.theme().raised
} else { } else {
cx.theme().ghost_element_background gpui::transparent_black()
} }
} }
ButtonVariant::Custom(colors) => colors.color, ButtonVariant::Custom(colors) => colors.color,
@@ -488,11 +488,11 @@ impl ButtonVariant {
fn text_color(&self, cx: &App) -> Hsla { fn text_color(&self, cx: &App) -> Hsla {
match self { match self {
ButtonVariant::Primary => cx.theme().element_foreground, ButtonVariant::Primary => cx.theme().accent.on,
ButtonVariant::Secondary => cx.theme().secondary_foreground, ButtonVariant::Secondary => cx.theme().accent.text_on_wash,
ButtonVariant::Danger => cx.theme().danger_foreground, ButtonVariant::Danger => cx.theme().accent.on_danger,
ButtonVariant::Warning => cx.theme().warning_foreground, ButtonVariant::Warning => cx.theme().accent.on_danger,
ButtonVariant::Transparent => cx.theme().text_placeholder, ButtonVariant::Transparent => cx.theme().text_faint,
ButtonVariant::Ghost { alt } => { ButtonVariant::Ghost { alt } => {
if *alt { if *alt {
cx.theme().text cx.theme().text
@@ -506,19 +506,19 @@ impl ButtonVariant {
fn hovered(&self, cx: &App) -> ButtonVariantStyle { fn hovered(&self, cx: &App) -> ButtonVariantStyle {
let bg = match self { let bg = match self {
ButtonVariant::Primary => cx.theme().element_hover, ButtonVariant::Primary => cx.theme().accent.hover,
ButtonVariant::Secondary => cx.theme().secondary_hover, ButtonVariant::Secondary => cx.theme().accent.selection,
ButtonVariant::Danger => cx.theme().danger_hover, ButtonVariant::Danger => cx.theme().danger.opacity(0.15),
ButtonVariant::Warning => cx.theme().warning_hover, ButtonVariant::Warning => cx.theme().warning.opacity(0.15),
ButtonVariant::Ghost { .. } => cx.theme().ghost_element_hover, ButtonVariant::Ghost { .. } => cx.theme().hover,
ButtonVariant::Transparent => gpui::transparent_black(), ButtonVariant::Transparent => gpui::transparent_black(),
ButtonVariant::Custom(colors) => colors.hover, ButtonVariant::Custom(colors) => colors.hover,
}; };
let fg = match self { let fg = match self {
ButtonVariant::Secondary => cx.theme().secondary_foreground, ButtonVariant::Secondary => cx.theme().accent.text_on_wash,
ButtonVariant::Ghost { .. } => cx.theme().text, ButtonVariant::Ghost { .. } => cx.theme().text,
ButtonVariant::Transparent => cx.theme().text_placeholder, ButtonVariant::Transparent => cx.theme().text_faint,
_ => self.text_color(cx), _ => self.text_color(cx),
}; };
@@ -527,18 +527,18 @@ impl ButtonVariant {
fn active(&self, cx: &App) -> ButtonVariantStyle { fn active(&self, cx: &App) -> ButtonVariantStyle {
let bg = match self { let bg = match self {
ButtonVariant::Primary => cx.theme().element_active, ButtonVariant::Primary => cx.theme().accent.active,
ButtonVariant::Secondary => cx.theme().secondary_active, ButtonVariant::Secondary => cx.theme().accent.selection,
ButtonVariant::Danger => cx.theme().danger_active, ButtonVariant::Danger => cx.theme().danger.opacity(0.25),
ButtonVariant::Warning => cx.theme().warning_active, ButtonVariant::Warning => cx.theme().warning.opacity(0.25),
ButtonVariant::Ghost { .. } => cx.theme().ghost_element_active, ButtonVariant::Ghost { .. } => cx.theme().active,
ButtonVariant::Transparent => gpui::transparent_black(), ButtonVariant::Transparent => gpui::transparent_black(),
ButtonVariant::Custom(colors) => colors.active, ButtonVariant::Custom(colors) => colors.active,
}; };
let fg = match self { let fg = match self {
ButtonVariant::Secondary => cx.theme().secondary_foreground, ButtonVariant::Secondary => cx.theme().accent.text_on_wash,
ButtonVariant::Transparent => cx.theme().text_placeholder, ButtonVariant::Transparent => cx.theme().text_faint,
_ => self.text_color(cx), _ => self.text_color(cx),
}; };
@@ -547,18 +547,18 @@ impl ButtonVariant {
fn selected(&self, cx: &App) -> ButtonVariantStyle { fn selected(&self, cx: &App) -> ButtonVariantStyle {
let bg = match self { let bg = match self {
ButtonVariant::Primary => cx.theme().element_selected, ButtonVariant::Primary => cx.theme().accent.selected,
ButtonVariant::Secondary => cx.theme().secondary_selected, ButtonVariant::Secondary => cx.theme().accent.selection,
ButtonVariant::Danger => cx.theme().danger_selected, ButtonVariant::Danger => cx.theme().danger.opacity(0.25),
ButtonVariant::Warning => cx.theme().warning_selected, ButtonVariant::Warning => cx.theme().warning.opacity(0.25),
ButtonVariant::Ghost { .. } => cx.theme().ghost_element_selected, ButtonVariant::Ghost { .. } => cx.theme().active,
ButtonVariant::Transparent => gpui::transparent_black(), ButtonVariant::Transparent => gpui::transparent_black(),
ButtonVariant::Custom(colors) => colors.active, ButtonVariant::Custom(colors) => colors.active,
}; };
let fg = match self { let fg = match self {
ButtonVariant::Secondary => cx.theme().secondary_foreground, ButtonVariant::Secondary => cx.theme().accent.text_on_wash,
ButtonVariant::Transparent => cx.theme().text_placeholder, ButtonVariant::Transparent => cx.theme().text_faint,
_ => self.text_color(cx), _ => self.text_color(cx),
}; };
@@ -567,11 +567,11 @@ impl ButtonVariant {
fn disabled(&self, cx: &App) -> ButtonVariantStyle { fn disabled(&self, cx: &App) -> ButtonVariantStyle {
let bg = match self { let bg = match self {
ButtonVariant::Danger => cx.theme().danger_disabled, ButtonVariant::Danger => cx.theme().danger.opacity(0.12),
ButtonVariant::Warning => cx.theme().warning_disabled, ButtonVariant::Warning => cx.theme().warning.opacity(0.12),
ButtonVariant::Ghost { .. } => cx.theme().ghost_element_disabled, ButtonVariant::Ghost { .. } => cx.theme().border.opacity(0.4),
ButtonVariant::Secondary => cx.theme().secondary_disabled, ButtonVariant::Secondary => cx.theme().accent.wash.opacity(0.5),
_ => cx.theme().element_disabled, _ => cx.theme().accent.primary.opacity(0.3),
}; };
let fg = match self { let fg = match self {
+4 -4
View File
@@ -381,10 +381,10 @@ impl RenderOnce for Dialog {
.icon(IconName::CloseCircleFill) .icon(IconName::CloseCircleFill)
.custom( .custom(
ButtonCustomVariant::new(window, cx) ButtonCustomVariant::new(window, cx)
.foreground(cx.theme().icon_muted) .foreground(cx.theme().text_faint)
.color(cx.theme().ghost_element_background) .color(gpui::transparent_black())
.hover(cx.theme().ghost_element_background) .hover(gpui::transparent_black())
.active(cx.theme().ghost_element_background), .active(gpui::transparent_black()),
) )
.on_click(move |_, window, cx| { .on_click(move |_, window, cx| {
on_cancel(&ClickEvent::default(), window, cx); on_cancel(&ClickEvent::default(), window, cx);
+6 -6
View File
@@ -446,7 +446,7 @@ impl TabGroupSkin {
.flex_grow_1() .flex_grow_1()
.min_w_16() .min_w_16()
.when(droppable, |this| { .when(droppable, |this| {
this.drag_over::<DragPanel>(|this, _, _, cx| this.bg(cx.theme().surface_background)) this.drag_over::<DragPanel>(|this, _, _, cx| this.bg(cx.theme().accent.selection))
.on_drop({ .on_drop({
let group = TabGroupContext::clone(group); let group = TabGroupContext::clone(group);
move |drag: &DragPanel, window, cx| { move |drag: &DragPanel, window, cx| {
@@ -465,7 +465,7 @@ impl TabGroupSkin {
let bar = TabBar::new("tab-bar") let bar = TabBar::new("tab-bar")
.track_scroll(&self.scroll_handle) .track_scroll(&self.scroll_handle)
.h(TABBAR_HEIGHT) .h(TABBAR_HEIGHT)
.bg(cx.theme().panel_background) .bg(cx.theme().shell)
.when(needs_traffic_light_padding, |this| { .when(needs_traffic_light_padding, |this| {
this.pl(px(TRAFFIC_LIGHT_PADDING)) this.pl(px(TRAFFIC_LIGHT_PADDING))
}) })
@@ -567,7 +567,7 @@ impl TabGroupSkin {
h_flex() h_flex()
.h(TABBAR_HEIGHT) .h(TABBAR_HEIGHT)
.w_full() .w_full()
.bg(cx.theme().panel_background) .bg(cx.theme().shell)
.child(bar.flex_1()) .child(bar.flex_1())
.child(window_controls()) .child(window_controls())
.into_any_element() .into_any_element()
@@ -717,7 +717,7 @@ impl TabGroupRenderer for TabGroupSkin {
.child( .child(
div() div()
.size_full() .size_full()
.bg(cx.theme().panel_background) .bg(cx.theme().shell)
.overflow_hidden() .overflow_hidden()
.child(panel.cached(StyleRefinement::default().v_flex().size_full())), .child(panel.cached(StyleRefinement::default().v_flex().size_full())),
) )
@@ -760,8 +760,8 @@ impl TabGroupRenderer for TabGroupSkin {
.h(height) .h(height)
.rounded(cx.theme().radius_lg) .rounded(cx.theme().radius_lg)
.border_1() .border_1()
.border_color(cx.theme().element_disabled) .border_color(cx.theme().accent.primary.opacity(0.3))
.bg(cx.theme().drop_target_background) .bg(cx.theme().accent.selection)
.into_any_element(), .into_any_element(),
) )
} }
+1 -1
View File
@@ -106,7 +106,7 @@ impl RenderOnce for GroupBox {
fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement { fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement {
let (bg, has_paddings) = match self.variant { let (bg, has_paddings) = match self.variant {
GroupBoxVariant::Normal => (None, false), GroupBoxVariant::Normal => (None, false),
GroupBoxVariant::Fill => (Some(cx.theme().surface_background), true), GroupBoxVariant::Fill => (Some(cx.theme().shell), true),
}; };
v_flex() v_flex()
+1 -1
View File
@@ -291,7 +291,7 @@ impl From<Icon> for AnyElement {
impl Render for Icon { impl Render for Icon {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement { fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let text_color = self.text_color.unwrap_or_else(|| cx.theme().icon); let text_color = self.text_color.unwrap_or_else(|| cx.theme().text_muted);
let text_size = window.text_style().font_size.to_pixels(window.rem_size()); let text_size = window.text_style().font_size.to_pixels(window.rem_size());
let has_base_size = self.style.size.width.is_some() || self.style.size.height.is_some(); let has_base_size = self.style.size.width.is_some() || self.style.size.height.is_some();
+1 -1
View File
@@ -11,5 +11,5 @@ pub(crate) fn clear_button(cx: &App) -> Button {
.ghost() .ghost()
.xsmall() .xsmall()
.tab_stop(false) .tab_stop(false)
.text_color(cx.theme().icon_muted) .text_color(cx.theme().text_faint)
} }
+4 -4
View File
@@ -16,9 +16,9 @@ use crate::{IconName, Selectable, Sizable, Size, StyleSized, StyledExt, h_flex,
/// The background of an input frame, which reads muted while the input is disabled. /// The background of an input frame, which reads muted while the input is disabled.
fn input_background(disabled: bool, cx: &App) -> Hsla { fn input_background(disabled: bool, cx: &App) -> Hsla {
if disabled { if disabled {
cx.theme().surface_background cx.theme().shell
} else { } else {
cx.theme().elevated_surface_background cx.theme().input
} }
} }
@@ -32,9 +32,9 @@ fn input_editor_style(cx: &App) -> InputEditorStyle {
InputEditorStyle { InputEditorStyle {
foreground: theme.text, foreground: theme.text,
muted_foreground: theme.text_muted, muted_foreground: theme.text_muted,
background: theme.elevated_surface_background, background: theme.input,
border: theme.border, border: theme.border,
selection: theme.selection, selection: theme.accent.selection,
caret: theme.cursor, caret: theme.cursor,
..InputEditorStyle::default() ..InputEditorStyle::default()
} }
+1 -1
View File
@@ -199,7 +199,7 @@ impl RenderOnce for Kbd {
.border_1() .border_1()
.border_color(cx.theme().border) .border_color(cx.theme().border)
.text_color(cx.theme().text_muted) .text_color(cx.theme().text_muted)
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.py_0p5() .py_0p5()
.px_1() .px_1()
.min_w_5() .min_w_5()
+2 -2
View File
@@ -69,8 +69,8 @@ impl RenderedText {
TextViewStyle::default() TextViewStyle::default()
.with_foreground(theme.text) .with_foreground(theme.text)
.with_muted_foreground(theme.text_muted) .with_muted_foreground(theme.text_muted)
.with_link(theme.text_accent) .with_link(theme.accent.primary)
.with_code_background(theme.elevated_surface_background) .with_code_background(theme.raised)
.with_border(theme.border) .with_border(theme.border)
.with_code_block(code_block) .with_code_block(code_block)
.with_dark(theme.is_dark()), .with_dark(theme.is_dark()),
+4 -4
View File
@@ -104,12 +104,12 @@ impl RenderOnce for MenuItemElement {
}) })
.when(!self.disabled, |this| { .when(!self.disabled, |this| {
this.group_hover(self.group_name, |this| { this.group_hover(self.group_name, |this| {
this.bg(cx.theme().secondary_background) this.bg(cx.theme().accent.wash)
.text_color(cx.theme().secondary_foreground) .text_color(cx.theme().accent.text_on_wash)
}) })
.when(self.selected, |this| { .when(self.selected, |this| {
this.bg(cx.theme().secondary_background) this.bg(cx.theme().accent.selection)
.text_color(cx.theme().secondary_foreground) .text_color(cx.theme().accent.text_on_wash)
}) })
.when_some(self.on_click, |this, on_click| { .when_some(self.on_click, |this, on_click| {
this.on_mouse_down(MouseButton::Left, move |_, _, cx| { this.on_mouse_down(MouseButton::Left, move |_, _, cx| {
+3 -3
View File
@@ -192,7 +192,7 @@ impl RenderOnce for MessageRow {
h_flex() h_flex()
.gap_2() .gap_2()
.text_sm() .text_sm()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.when_some(author, |this, author| { .when_some(author, |this, author| {
this.child(div().font_semibold().child(author)) this.child(div().font_semibold().child(author))
}) })
@@ -212,7 +212,7 @@ impl RenderOnce for MessageRow {
.when_some(on_double_click, |this, listener| { .when_some(on_double_click, |this, listener| {
this.on_double_click(listener) this.on_double_click(listener)
}) })
.hover(|this| this.bg(cx.theme().surface_background)) .hover(|this| this.bg(cx.theme().shell))
.into_any_element() .into_any_element()
} }
} }
@@ -315,7 +315,7 @@ impl RenderOnce for WelcomeMessage {
this.child( this.child(
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(message), .child(message),
) )
}), }),
+2 -4
View File
@@ -126,10 +126,8 @@ impl RenderOnce for Nav {
) )
.when(clickable, |this| { .when(clickable, |this| {
this.cursor_pointer() this.cursor_pointer()
.hover(|this| this.bg(cx.theme().ghost_element_hover)) .hover(|this| this.bg(cx.theme().hover))
.when(self.selected, |this| { .when(self.selected, |this| this.bg(cx.theme().active))
this.bg(cx.theme().ghost_element_active)
})
}) })
.when_some(self.on_click, |this, handler| { .when_some(self.on_click, |this, handler| {
this.on_click(move |event, window, cx| handler(event, window, cx)) this.on_click(move |event, window, cx| handler(event, window, cx))
+2 -4
View File
@@ -119,10 +119,8 @@ impl RenderOnce for NavItem {
}) })
.when(clickable, |this| { .when(clickable, |this| {
this.cursor_pointer() this.cursor_pointer()
.hover(|this| this.bg(cx.theme().ghost_element_hover)) .hover(|this| this.bg(cx.theme().hover))
.when(self.selected, |this| { .when(self.selected, |this| this.bg(cx.theme().active))
this.bg(cx.theme().ghost_element_active)
})
}) })
.when_some(self.on_click, |this, handler| { .when_some(self.on_click, |this, handler| {
this.on_click(move |event, window, cx| handler(event, window, cx)) this.on_click(move |event, window, cx| handler(event, window, cx))
+7 -7
View File
@@ -43,16 +43,16 @@ impl NotificationKind {
match self { match self {
Self::Info => Icon::new(IconName::Info) Self::Info => Icon::new(IconName::Info)
.with_size(Size::Medium) .with_size(Size::Medium)
.text_color(cx.theme().icon), .text_color(cx.theme().text_muted),
Self::Success => Icon::new(IconName::CheckCircle) Self::Success => Icon::new(IconName::CheckCircle)
.with_size(Size::Medium) .with_size(Size::Medium)
.text_color(cx.theme().icon_accent), .text_color(cx.theme().accent.primary),
Self::Warning => Icon::new(IconName::Warning) Self::Warning => Icon::new(IconName::Warning)
.with_size(Size::Medium) .with_size(Size::Medium)
.text_color(cx.theme().text_warning), .text_color(cx.theme().warning),
Self::Error => Icon::new(IconName::CloseCircle) Self::Error => Icon::new(IconName::CloseCircle)
.with_size(Size::Medium) .with_size(Size::Medium)
.text_color(cx.theme().danger_foreground), .text_color(cx.theme().danger),
} }
} }
} }
@@ -300,12 +300,12 @@ impl Render for Notification {
}; };
let background = match self.kind { let background = match self.kind {
Some(NotificationKind::Error) => cx.theme().danger_background, Some(NotificationKind::Error) => cx.theme().danger_muted,
_ => cx.theme().surface_background, _ => cx.theme().shell,
}; };
let text_color = match self.kind { let text_color = match self.kind {
Some(NotificationKind::Error) => cx.theme().danger_foreground, Some(NotificationKind::Error) => cx.theme().danger,
_ => cx.theme().text, _ => cx.theme().text,
}; };
+2 -2
View File
@@ -12,7 +12,7 @@ pub(crate) fn resize_handle_appearance() -> ResizeHandleRenderer {
Rc::new( Rc::new(
|context: &ResizeHandleContext, _: &mut Window, cx: &mut App| { |context: &ResizeHandleContext, _: &mut Window, cx: &mut App| {
let color = if context.is_active() { let color = if context.is_active() {
cx.theme().border_selected cx.theme().accent.primary
} else { } else {
cx.theme().border cx.theme().border
}; };
@@ -20,7 +20,7 @@ pub(crate) fn resize_handle_appearance() -> ResizeHandleRenderer {
Some( Some(
div() div()
.bg(cx.theme().border_variant) .bg(cx.theme().border)
.group_hover("handle", move |this| this.bg(color)) .group_hover("handle", move |this| this.bg(color))
.when(axis.is_horizontal(), |this| this.h_full().w(HANDLE_SIZE)) .when(axis.is_horizontal(), |this| this.h_full().w(HANDLE_SIZE))
.when(axis.is_vertical(), |this| this.w_full().h(HANDLE_SIZE)) .when(axis.is_vertical(), |this| this.w_full().h(HANDLE_SIZE))
+1 -1
View File
@@ -381,7 +381,7 @@ impl Render for Root {
}) })
.size_full() .size_full()
.font_family(font_family) .font_family(font_family)
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.text_color(cx.theme().text) .text_color(cx.theme().text)
.child(TextSelectionLayer) .child(TextSelectionLayer)
.child(self.view.clone()), .child(self.view.clone()),
+6 -6
View File
@@ -57,14 +57,14 @@ fn scrollbar<H: ScrollbarHandle + Clone>(
styles styles
.track(|track| { .track(|track| {
track track
.bg(theme.scrollbar_track_background) .bg(gpui::transparent_black())
.border_color(theme.scrollbar_thumb_border) .border_color(gpui::transparent_black())
.width(px(10.)) .width(px(10.))
}) })
.track_hover(|track| track.bg(theme.scrollbar_thumb_background).width(px(10.))) .track_hover(|track| track.bg(theme.border.opacity(0.7)).width(px(10.)))
.thumb(|thumb| { .thumb(|thumb| {
thumb thumb
.bg(theme.scrollbar_thumb_background) .bg(theme.border.opacity(0.7))
.width(thumb_width) .width(thumb_width)
.inset(px(1.)) .inset(px(1.))
.radius(thumb_radius) .radius(thumb_radius)
@@ -72,14 +72,14 @@ fn scrollbar<H: ScrollbarHandle + Clone>(
}) })
.thumb_hover(|thumb| { .thumb_hover(|thumb| {
thumb thumb
.bg(theme.scrollbar_thumb_hover_background) .bg(theme.border_strong)
.width(px(8.)) .width(px(8.))
.inset(px(1.)) .inset(px(1.))
.radius(px(4.)) .radius(px(4.))
}) })
.thumb_active(|thumb| { .thumb_active(|thumb| {
thumb thumb
.bg(theme.scrollbar_thumb_hover_background) .bg(theme.border_strong)
.width(px(8.)) .width(px(8.))
.inset(px(1.)) .inset(px(1.))
.radius(px(4.)) .radius(px(4.))
+1 -1
View File
@@ -15,7 +15,7 @@ pub fn v_flex() -> Div {
/// Returns a `Div` as divider. /// Returns a `Div` as divider.
pub fn divider(cx: &App) -> Div { pub fn divider(cx: &App) -> Div {
div().my_1().w_full().h_px().bg(cx.theme().border_variant) div().my_1().w_full().h_px().bg(cx.theme().border)
} }
macro_rules! font_weight { macro_rules! font_weight {
+3 -3
View File
@@ -85,8 +85,8 @@ impl RenderOnce for Switch {
let on_click = self.on_click.clone(); let on_click = self.on_click.clone();
let (bg, toggle_bg) = match checked { let (bg, toggle_bg) = match checked {
true => (cx.theme().element_background, white()), true => (cx.theme().accent.primary, white()),
false => (cx.theme().elevated_surface_background, white()), false => (cx.theme().raised, white()),
}; };
let (bg, toggle_bg) = match self.disabled { let (bg, toggle_bg) = match self.disabled {
@@ -155,7 +155,7 @@ impl RenderOnce for Switch {
.flex() .flex()
.items_center() .items_center()
.border(inset) .border(inset)
.border_color(cx.theme().border_transparent) .border_color(gpui::transparent_black())
.bg(bg) .bg(bg)
.when(!self.disabled, |this| this.cursor_pointer()) .when(!self.disabled, |this| this.cursor_pointer())
.child( .child(
+6 -11
View File
@@ -193,9 +193,9 @@ impl RenderOnce for Tab {
let foreground = if disabled { let foreground = if disabled {
cx.theme().text_muted cx.theme().text_muted
} else if selected { } else if selected {
cx.theme().tab_active_foreground cx.theme().text
} else { } else {
cx.theme().tab_foreground cx.theme().text_muted
}; };
let content = h_flex() let content = h_flex()
@@ -227,11 +227,11 @@ impl RenderOnce for Tab {
.h_6() .h_6()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.when(selected && !disabled, |this| { .when(selected && !disabled, |this| {
this.bg(cx.theme().tab_active_background) this.bg(cx.theme().background)
.when(cx.theme().shadow, |this| this.shadow_sm()) .when(cx.theme().shadow, |this| this.shadow_sm())
}) })
.when(!selected && !disabled, |this| { .when(!selected && !disabled, |this| {
this.hover(|this| this.bg(cx.theme().tab_hover_background)) this.hover(|this| this.bg(cx.theme().hover))
}) })
}) })
.when(!segmented, |this| { .when(!segmented, |this| {
@@ -243,14 +243,9 @@ impl RenderOnce for Tab {
.text_sm() .text_sm()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.overflow_hidden() .overflow_hidden()
.when(selected && !disabled, |this| { .when(selected && !disabled, |this| this.bg(cx.theme().shell))
this.bg(cx.theme().tab_background)
})
.when(!selected && !disabled, |this| { .when(!selected && !disabled, |this| {
this.hover(|this| { this.hover(|this| this.bg(cx.theme().hover).text_color(cx.theme().text))
this.bg(cx.theme().tab_hover_background)
.text_color(cx.theme().tab_active_foreground)
})
}) })
}) })
.when_some(prefix, |this, prefix| this.child(prefix)) .when_some(prefix, |this, prefix| this.child(prefix))
+1 -3
View File
@@ -124,9 +124,7 @@ impl RenderOnce for TabBar {
.min_w_0() .min_w_0()
.refine_style(&self.style) .refine_style(&self.style)
.when(segmented, |this| { .when(segmented, |this| {
this.bg(cx.theme().tab_background) this.bg(cx.theme().shell).p_0p5().rounded(cx.theme().radius)
.p_0p5()
.rounded(cx.theme().radius)
}) })
.when_some(self.prefix, |this, prefix| this.child(prefix)) .when_some(self.prefix, |this, prefix| this.child(prefix))
.child( .child(
+5 -5
View File
@@ -79,7 +79,7 @@ impl ControlIcon {
#[inline] #[inline]
fn hover_fg(&self, cx: &App) -> Hsla { fn hover_fg(&self, cx: &App) -> Hsla {
if self.is_close() { if self.is_close() {
cx.theme().danger_foreground cx.theme().danger
} else { } else {
cx.theme().text cx.theme().text
} }
@@ -88,18 +88,18 @@ impl ControlIcon {
#[inline] #[inline]
fn hover_bg(&self, cx: &App) -> Hsla { fn hover_bg(&self, cx: &App) -> Hsla {
if self.is_close() { if self.is_close() {
cx.theme().danger_background cx.theme().danger_muted
} else { } else {
cx.theme().ghost_element_hover cx.theme().hover
} }
} }
#[inline] #[inline]
fn active_bg(&self, cx: &mut App) -> Hsla { fn active_bg(&self, cx: &mut App) -> Hsla {
if self.is_close() { if self.is_close() {
cx.theme().danger_active cx.theme().danger.opacity(0.25)
} else { } else {
cx.theme().ghost_element_active cx.theme().active
} }
} }
} }
+1 -1
View File
@@ -25,7 +25,7 @@ impl Render for Tooltip {
.p_1p5() .p_1p5()
.border_1() .border_1()
.border_color(cx.theme().border) .border_color(cx.theme().border)
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.when(cx.theme().shadow, |this| this.shadow_sm()) .when(cx.theme().shadow, |this| this.shadow_sm())
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.text_xs() .text_xs()
+3 -3
View File
@@ -255,7 +255,7 @@ impl Render for ImportIdentity {
this.child( this.child(
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().text_warning) .text_color(cx.theme().warning)
.child(div().child(BUNKER_WARN)), .child(div().child(BUNKER_WARN)),
) )
}) })
@@ -263,7 +263,7 @@ impl Render for ImportIdentity {
this.child( this.child(
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().text_warning) .text_color(cx.theme().warning)
.child(div().child(KEY_WARN)), .child(div().child(KEY_WARN)),
) )
}), }),
@@ -297,7 +297,7 @@ impl Render for ImportIdentity {
div() div()
.text_xs() .text_xs()
.text_center() .text_center()
.text_color(cx.theme().text_danger) .text_color(cx.theme().danger)
.child(error.clone()), .child(error.clone()),
) )
}) })
+4 -4
View File
@@ -380,9 +380,9 @@ impl NewChat {
.gap_1() .gap_1()
.p_0p5() .p_0p5()
.rounded_full() .rounded_full()
.bg(cx.theme().ghost_element_background_alt) .bg(cx.theme().raised)
.text_size(px(10.)) .text_size(px(10.))
.hover(|this| this.bg(cx.theme().ghost_element_hover)) .hover(|this| this.bg(cx.theme().hover))
.child( .child(
Avatar::from_source(profile.avatar()) Avatar::from_source(profile.avatar())
.seed(profile.avatar_seed()) .seed(profile.avatar_seed())
@@ -430,14 +430,14 @@ impl Render for NewChat {
this.child( this.child(
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().text_danger) .text_color(cx.theme().danger)
.child(error), .child(error),
) )
} else { } else {
this.child( this.child(
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(notice), .child(notice),
) )
} }
+2 -2
View File
@@ -366,7 +366,7 @@ impl Render for ProfileDialog {
.w_full() .w_full()
.items_center() .items_center()
.justify_center() .justify_center()
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.child(Avatar::new(avatar).seed(profile.avatar_seed()).large()) .child(Avatar::new(avatar).seed(profile.avatar_seed()).large())
.when(self.editing, |this| { .when(self.editing, |this| {
this.child( this.child(
@@ -392,7 +392,7 @@ impl Render for ProfileDialog {
.justify_center() .justify_center()
.gap_3() .gap_3()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.text_sm() .text_sm()
.child(shorten_pkey) .child(shorten_pkey)
.child( .child(
+3 -3
View File
@@ -154,7 +154,7 @@ impl RelayManager {
div() div()
.italic() .italic()
.text_xs() .text_xs()
.text_color(cx.theme().text_danger) .text_color(cx.theme().danger)
.child(error.clone()), .child(error.clone()),
) )
}) })
@@ -225,7 +225,7 @@ impl RelayManager {
div() div()
.italic() .italic()
.text_xs() .text_xs()
.text_color(cx.theme().text_danger) .text_color(cx.theme().danger)
.child(error.clone()), .child(error.clone()),
) )
}) })
@@ -647,7 +647,7 @@ fn relay_row(
.px_2() .px_2()
.justify_between() .justify_between()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.child( .child(
h_flex() h_flex()
.gap_1() .gap_1()
+1 -1
View File
@@ -122,7 +122,7 @@ impl Render for RestoreEncryption {
div() div()
.text_xs() .text_xs()
.text_center() .text_center()
.text_color(cx.theme().text_danger) .text_color(cx.theme().danger)
.child(error.clone()), .child(error.clone()),
) )
}) })
+4 -4
View File
@@ -294,7 +294,7 @@ impl Screening {
.gap_1p5() .gap_1p5()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.text_sm() .text_sm()
.hover(|this| this.bg(cx.theme().elevated_surface_background)) .hover(|this| this.bg(cx.theme().raised))
.child(Avatar::new(profile.avatar()).small()) .child(Avatar::new(profile.avatar()).small())
.child(profile.name()), .child(profile.name()),
); );
@@ -353,7 +353,7 @@ impl Render for Screening {
.h_7() .h_7()
.justify_center() .justify_center()
.rounded_full() .rounded_full()
.bg(cx.theme().elevated_surface_background) .bg(cx.theme().raised)
.text_sm() .text_sm()
.truncate() .truncate()
.text_ellipsis() .text_ellipsis()
@@ -533,9 +533,9 @@ fn status_badge(status: Option<bool>, cx: &App) -> Div {
if let Some(status) = status { if let Some(status) = status {
this.child(Icon::new(IconName::CheckCircle).small().text_color({ this.child(Icon::new(IconName::CheckCircle).small().text_color({
if status { if status {
cx.theme().icon_accent cx.theme().accent.primary
} else { } else {
cx.theme().icon_muted cx.theme().text_faint
} }
})) }))
} else { } else {
+1 -1
View File
@@ -203,7 +203,7 @@ impl Render for Preferences {
div() div()
.text_size(px(10.)) .text_size(px(10.))
.italic() .italic()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(SharedString::from("Only support blossom service")), .child(SharedString::from("Only support blossom service")),
), ),
), ),
+3 -3
View File
@@ -439,7 +439,7 @@ impl Workspace {
.child( .child(
div() div()
.italic() .italic()
.text_color(cx.theme().text_danger) .text_color(cx.theme().danger)
.child(SharedString::from(ENC_WARN)), .child(SharedString::from(ENC_WARN)),
), ),
) )
@@ -487,8 +487,8 @@ impl Workspace {
.w_full() .w_full()
.justify_between() .justify_between()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().ghost_element_background) .bg(gpui::transparent_black())
.hover(|this| this.bg(cx.theme().ghost_element_hover)) .hover(|this| this.bg(cx.theme().hover))
.child( .child(
h_flex() h_flex()
.gap_1p5() .gap_1p5()
+7 -7
View File
@@ -295,7 +295,7 @@ impl BrowsePanel {
.max_w_64() .max_w_64()
.px_1() .px_1()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.child( .child(
Input::new(&self.input) Input::new(&self.input)
.appearance(false) .appearance(false)
@@ -378,11 +378,11 @@ impl BrowsePanel {
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.cursor_pointer() .cursor_pointer()
.border_1() .border_1()
.border_color(cx.theme().border_transparent) .border_color(gpui::transparent_black())
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.hover(|this| { .hover(|this| {
this.bg(cx.theme().elevated_surface_background) this.bg(cx.theme().raised)
.border_color(cx.theme().border_focused) .border_color(cx.theme().accent.primary)
}) })
.child( .child(
v_flex() v_flex()
@@ -414,7 +414,7 @@ impl BrowsePanel {
div() div()
.truncate() .truncate()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(relay), .child(relay),
), ),
), ),
@@ -467,7 +467,7 @@ impl Panel for BrowsePanel {
.child( .child(
Icon::new(IconName::Compass) Icon::new(IconName::Compass)
.small() .small()
.text_color(cx.theme().icon_muted), .text_color(cx.theme().text_faint),
) )
.child(TITLE) .child(TITLE)
.into_any_element() .into_any_element()
+2 -2
View File
@@ -234,7 +234,7 @@ impl ContactListPanel {
.px_2() .px_2()
.justify_between() .justify_between()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.hover(|this| this.bg(cx.theme().ghost_element_hover)) .hover(|this| this.bg(cx.theme().hover))
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
@@ -343,7 +343,7 @@ impl Render for ContactListPanel {
div() div()
.italic() .italic()
.text_xs() .text_xs()
.text_color(cx.theme().text_danger) .text_color(cx.theme().danger)
.child(error.clone()), .child(error.clone()),
) )
}), }),
+1 -1
View File
@@ -91,7 +91,7 @@ impl Render for GreeterPanel {
svg() svg()
.path("brand/coop.svg") .path("brand/coop.svg")
.size_12() .size_12()
.text_color(cx.theme().icon_muted), .text_color(cx.theme().text_faint),
) )
.child( .child(
v_flex() v_flex()
+1 -1
View File
@@ -35,7 +35,7 @@ impl Panel for InboxPanel {
.child( .child(
Icon::new(IconName::Inbox) Icon::new(IconName::Inbox)
.small() .small()
.text_color(cx.theme().icon_muted), .text_color(cx.theme().text_faint),
) )
.child(self.name.clone()) .child(self.name.clone())
.into_any_element() .into_any_element()
+1 -1
View File
@@ -35,7 +35,7 @@ impl Panel for RequestsPanel {
.child( .child(
Icon::new(IconName::Invite) Icon::new(IconName::Invite)
.small() .small()
.text_color(cx.theme().icon_muted), .text_color(cx.theme().text_faint),
) )
.child(self.name.clone()) .child(self.name.clone())
.into_any_element() .into_any_element()
+2 -2
View File
@@ -437,7 +437,7 @@ impl Panel for SearchPanel {
.child( .child(
Icon::new(IconName::Search) Icon::new(IconName::Search)
.small() .small()
.text_color(cx.theme().icon_muted), .text_color(cx.theme().text_faint),
) )
.child(self.name.clone()) .child(self.name.clone())
.into_any_element() .into_any_element()
@@ -500,7 +500,7 @@ impl Render for SearchPanel {
.gap_1() .gap_1()
.flex_1() .flex_1()
.border_b_1() .border_b_1()
.border_color(cx.theme().border_variant) .border_color(cx.theme().border)
.child( .child(
h_flex() h_flex()
.gap_0p5() .gap_0p5()
+3 -3
View File
@@ -230,10 +230,10 @@ impl Sidebar {
Nav::new(label) Nav::new(label)
.label(label) .label(label)
.suffix(Icon::new(icon).small().text_color(cx.theme().icon_muted)) .suffix(Icon::new(icon).small().text_color(cx.theme().text_faint))
.text_xs() .text_xs()
.font_semibold() .font_semibold()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.on_click(cx.listener(move |this, _event, _window, cx| { .on_click(cx.listener(move |this, _event, _window, cx| {
match section { match section {
GroupSection::Admins => this.admins_open = !this.admins_open, GroupSection::Admins => this.admins_open = !this.admins_open,
@@ -277,7 +277,7 @@ impl Sidebar {
div() div()
.truncate() .truncate()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(SharedString::from(roles.join(", "))), .child(SharedString::from(roles.join(", "))),
) )
}) })
+4 -4
View File
@@ -89,7 +89,7 @@ impl Sidebar {
.text_color(cx.theme().text_muted) .text_color(cx.theme().text_muted)
.text_center() .text_center()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().elevated_surface_background) .bg(cx.theme().raised)
.child(SharedString::from( .child(SharedString::from(
request_count.to_string(), request_count.to_string(),
)), )),
@@ -102,7 +102,7 @@ impl Sidebar {
) )
}) })
.when(requests_open, |this| { .when(requests_open, |this| {
this.bg(cx.theme().ghost_element_active) this.bg(cx.theme().active)
}) })
.on_click(cx.listener(|this, _event, _window, cx| { .on_click(cx.listener(|this, _event, _window, cx| {
this.toggle_requests(cx); this.toggle_requests(cx);
@@ -111,7 +111,7 @@ impl Sidebar {
.child( .child(
NavItem::new("contacts", "Contacts", Icon::new(IconName::Book).small()) NavItem::new("contacts", "Contacts", Icon::new(IconName::Book).small())
.when(contacts_open, |this| { .when(contacts_open, |this| {
this.bg(cx.theme().ghost_element_active) this.bg(cx.theme().active)
}) })
.on_click(cx.listener(|this, _event, window, cx| { .on_click(cx.listener(|this, _event, window, cx| {
this.toggle_contacts(window, cx); this.toggle_contacts(window, cx);
@@ -124,7 +124,7 @@ impl Sidebar {
.px_4() .px_4()
.text_xs() .text_xs()
.font_semibold() .font_semibold()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(list_title), .child(list_title),
) )
}) })
+2 -2
View File
@@ -277,7 +277,7 @@ impl Render for Sidebar {
.size_full() .size_full()
.relative() .relative()
.gap_2() .gap_2()
.bg(cx.theme().surface_background) .bg(cx.theme().shell)
.when_some(current_user.as_ref(), |this, current_user| { .when_some(current_user.as_ref(), |this, current_user| {
this.child(title_bar_drag_handlers( this.child(title_bar_drag_handlers(
self.render_user(current_user, cx), self.render_user(current_user, cx),
@@ -336,7 +336,7 @@ impl Render for Sidebar {
.text_xs() .text_xs()
.font_semibold() .font_semibold()
.text_color(cx.theme().text_muted) .text_color(cx.theme().text_muted)
.child(Indicator::new().small().color(cx.theme().icon_accent)) .child(Indicator::new().small().color(cx.theme().accent.primary))
.child("Getting messages..."), .child("Getting messages..."),
), ),
) )
+7 -7
View File
@@ -89,10 +89,10 @@ impl Sidebar {
Nav::new(label) Nav::new(label)
.label(label) .label(label)
.suffix(Icon::new(icon).small().text_color(cx.theme().icon_muted)) .suffix(Icon::new(icon).small().text_color(cx.theme().text_faint))
.text_xs() .text_xs()
.font_semibold() .font_semibold()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.on_click(cx.listener(move |this, _event, _window, cx| { .on_click(cx.listener(move |this, _event, _window, cx| {
match section { match section {
ListSection::Pins => this.pins_open = !this.pins_open, ListSection::Pins => this.pins_open = !this.pins_open,
@@ -114,7 +114,7 @@ impl Sidebar {
.label(label) .label(label)
.text_xs() .text_xs()
.font_semibold() .font_semibold()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.into_any_element() .into_any_element()
} }
SidebarRow::Empty(text) => v_flex() SidebarRow::Empty(text) => v_flex()
@@ -132,7 +132,7 @@ impl Sidebar {
.border_color(cx.theme().border) .border_color(cx.theme().border)
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(*text), .child(*text),
) )
.into_any_element(), .into_any_element(),
@@ -162,7 +162,7 @@ impl Sidebar {
div() div()
.font_normal() .font_normal()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(created_at), .child(created_at),
) )
.on_click(move |_event, window, cx| { .on_click(move |_event, window, cx| {
@@ -279,7 +279,7 @@ impl Sidebar {
div() div()
.font_normal() .font_normal()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(suffix), .child(suffix),
) )
}) })
@@ -353,7 +353,7 @@ impl Sidebar {
div() div()
.font_normal() .font_normal()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_faint)
.child(detail), .child(detail),
) )
.on_click(move |_event, window, cx| { .on_click(move |_event, window, cx| {
+1 -1
View File
@@ -202,7 +202,7 @@ impl Sidebar {
.gap_1() .gap_1()
.w_full() .w_full()
.rounded(cx.theme().radius) .rounded(cx.theme().radius)
.bg(cx.theme().elevated_surface_background) .bg(cx.theme().raised)
.child( .child(
Input::new(&self.find_input) Input::new(&self.find_input)
.appearance(false) .appearance(false)