migrate chat_ui, workspace, and nip29_ui to bezel theme tokens

This commit is contained in:
2026-10-09 15:02:22 +07:00
parent 70540abd5d
commit 8e34ddabcb
24 changed files with 197 additions and 188 deletions
+6 -6
View File
@@ -3,7 +3,7 @@ use gpui::{
relative,
};
use nip29::{Group, GroupMetadata};
use theme::ActiveTheme;
use theme::{ActiveTheme, control_radius};
use ui::avatar::Avatar;
use ui::{Sizable, StyledExt, WindowExtension, h_flex, v_flex};
@@ -76,7 +76,7 @@ fn body(group: &WeakEntity<Group>, cx: &App) -> AnyElement {
"Supported kinds",
if items.is_empty() {
div()
.text_color(cx.theme().text_placeholder)
.text_color(cx.theme().text_faint)
.child("None")
.into_any_element()
} else {
@@ -145,7 +145,7 @@ fn header(group: &Group, cx: &App) -> AnyElement {
.child(
div()
.text_xs()
.text_color(cx.theme().text_placeholder)
.text_color(cx.theme().text_faint)
.truncate()
.child(SharedString::from(format!(
"{} · {}",
@@ -183,9 +183,9 @@ fn chip(label: impl Into<SharedString>, cx: &App) -> AnyElement {
div()
.px_2()
.py_1()
.rounded(cx.theme().radius)
.bg(cx.theme().secondary_background)
.text_color(cx.theme().secondary_foreground)
.rounded(px(control_radius()))
.bg(cx.theme().surface_raised)
.text_color(cx.theme().text)
.text_xs()
.line_height(relative(1.))
.child(label.into())
+7 -7
View File
@@ -16,7 +16,7 @@ use serde::Deserialize;
use settings::AppSettings;
use smallvec::{SmallVec, smallvec};
use state::{NostrRegistry, upload};
use theme::ActiveTheme;
use theme::{ActiveTheme, control_radius};
use ui::avatar::Avatar;
use ui::button::{Button, ButtonVariant, ButtonVariants};
use ui::dialog::DialogButtonProps;
@@ -576,7 +576,7 @@ impl GroupPanel {
.child(
Icon::new(IconName::Info)
.small()
.text_color(cx.theme().icon_muted),
.text_color(cx.theme().text_faint),
)
.child(div().flex_1().min_w_0().truncate().child(message))
.child(
@@ -615,8 +615,8 @@ impl GroupPanel {
div()
.px_1p5()
.py_0p5()
.rounded(cx.theme().radius)
.bg(cx.theme().element_background)
.rounded(px(control_radius()))
.bg(cx.theme().solid)
.text_xs()
.text_color(cx.theme().text_muted)
.child(pin_label(group, pin))
@@ -878,8 +878,8 @@ impl GroupPanel {
.h_8()
.px_2()
.border_1()
.border_color(cx.theme().border_variant)
.rounded(cx.theme().radius)
.border_color(cx.theme().border_faint)
.rounded(px(control_radius()))
.text_xs()
.text_color(cx.theme().text_muted)
.child(Icon::new(IconName::Link).xsmall())
@@ -988,7 +988,7 @@ impl Render for GroupPanel {
.size_full()
.justify_center()
.text_sm()
.text_color(cx.theme().text_placeholder)
.text_color(cx.theme().text_faint)
.child("No messages yet")
.into_any_element(),
}),
+13 -13
View File
@@ -9,7 +9,7 @@ use nip29::{Activity, Group};
use nostr_sdk::prelude::{EventId, Kind};
use person::PersonRegistry;
use settings::AppSettings;
use theme::ActiveTheme;
use theme::{ActiveTheme, bubble_radius};
use ui::avatar::Avatar;
use ui::menu::{ContextMenu, PopupMenu, PopupMenuItem};
use ui::message::MessageRow;
@@ -141,7 +141,7 @@ pub(crate) fn render_activity(ix: usize, activity: &Activity, cx: &App) -> AnyEl
.gap_2()
.py_1()
.px_3()
.hover(|this| this.bg(cx.theme().surface_background))
.hover(|this| this.bg(cx.theme().element_hover))
.child(badge(activity, cx))
.when(!hide_avatar, |this| {
this.child(
@@ -164,7 +164,7 @@ pub(crate) fn render_activity(ix: usize, activity: &Activity, cx: &App) -> AnyEl
.min_w_0()
.truncate()
.text_sm()
.text_color(cx.theme().text_placeholder)
.text_color(cx.theme().text_faint)
.child(SharedString::from(action(activity))),
)
.child(
@@ -172,7 +172,7 @@ pub(crate) fn render_activity(ix: usize, activity: &Activity, cx: &App) -> AnyEl
.flex_shrink_0()
.ml_1()
.text_xs()
.text_color(cx.theme().text_placeholder)
.text_color(cx.theme().text_faint)
.child(activity.created_at.to_ago()),
)
.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 {
let (icon, color) = match activity.kind {
Kind::GroupJoinRequest => (IconName::Login, cx.theme().icon_accent),
Kind::GroupPutUser => (IconName::Login, cx.theme().icon_accent),
Kind::GroupLeaveRequest => (IconName::Logout, cx.theme().text_danger),
Kind::GroupRemoveUser => (IconName::Ban, cx.theme().text_danger),
_ => (IconName::Info, cx.theme().icon_muted),
Kind::GroupJoinRequest => (IconName::Login, cx.theme().accent),
Kind::GroupPutUser => (IconName::Login, cx.theme().accent),
Kind::GroupLeaveRequest => (IconName::Logout, cx.theme().danger),
Kind::GroupRemoveUser => (IconName::Ban, cx.theme().danger),
_ => (IconName::Info, cx.theme().text_faint),
};
h_flex()
@@ -211,10 +211,10 @@ fn media(media: &[SharedUri], cx: &App) -> AnyElement {
.child(
img(only.clone())
.border_1()
.border_color(cx.theme().border_variant)
.border_color(cx.theme().border_faint)
.h(px(250.))
.object_fit(ObjectFit::Cover)
.rounded(cx.theme().radius),
.rounded(px(bubble_radius())),
)
.into_any_element();
}
@@ -231,8 +231,8 @@ fn media(media: &[SharedUri], cx: &App) -> AnyElement {
img(item.clone())
.h_32()
.border_1()
.border_color(cx.theme().border_variant)
.rounded(cx.theme().radius),
.border_color(cx.theme().border_faint)
.rounded(px(bubble_radius())),
)
}))
.into_any_element()