This commit is contained in:
2026-10-22 05:18:35 +07:00
parent 14b66d530c
commit b560ea4116
24 changed files with 87 additions and 88 deletions
+4 -3
View File
@@ -16,6 +16,7 @@ use gpui::{
retain_all, svg, white, retain_all, svg, white,
}; };
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::dock::{Panel, PanelEvent}; use gpui_kit::component::dock::{Panel, PanelEvent};
use gpui_kit::component::input::{Input, InputEvent, InputState, Textarea, TextareaState}; use gpui_kit::component::input::{Input, InputEvent, InputState, Textarea, TextareaState};
@@ -1295,7 +1296,7 @@ impl ChatPanel {
.child( .child(
h_flex() h_flex()
.gap_1() .gap_1()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.child(Avatar::new(avatar).seed(profile.avatar_seed()).small()) .child(Avatar::new(avatar).seed(profile.avatar_seed()).small())
.child(name.clone()), .child(name.clone()),
), ),
@@ -1334,7 +1335,7 @@ impl ChatPanel {
.child( .child(
div() div()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.line_height(relative(1.25)) .line_height(relative(1.25))
.child(SharedString::from(url.to_string())), .child(SharedString::from(url.to_string())),
) )
@@ -1364,7 +1365,7 @@ impl ChatPanel {
.child( .child(
div() div()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.line_height(relative(1.25)) .line_height(relative(1.25))
.child(SharedString::from(url.0.to_string())), .child(SharedString::from(url.0.to_string())),
) )
+2 -6
View File
@@ -211,11 +211,7 @@ impl RenderOnce for MessageRow {
.text_xs() .text_xs()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.when_some(author, |this, author| { .when_some(author, |this, author| {
this.child( this.child(div().font_semibold().child(author))
div()
.font_weight(gpui::FontWeight::SEMIBOLD)
.child(author),
)
}) })
.when_some(timestamp, |this, timestamp| { .when_some(timestamp, |this, timestamp| {
this.child(timestamp) this.child(timestamp)
@@ -299,7 +295,7 @@ impl RenderOnce for ReplyPreview {
.border_color(cx.theme().list_active) .border_color(cx.theme().list_active)
.text_xs() .text_xs()
.refine_style(&style) .refine_style(&style)
.child(div().font_weight(gpui::FontWeight::SEMIBOLD).child(author)) .child(div().font_semibold().child(author))
.child(div().w_full().text_ellipsis().line_clamp(1).child(preview)) .child(div().w_full().text_ellipsis().line_clamp(1).child(preview))
.hover(|this| this.bg(cx.theme().secondary)) .hover(|this| this.bg(cx.theme().secondary))
.when_some(on_click, |this, on_click| this.on_click(on_click)) .when_some(on_click, |this, on_click| this.on_click(on_click))
+3 -2
View File
@@ -2,6 +2,7 @@ use gpui::{
AnyElement, App, IntoElement, ParentElement, SharedString, Styled, WeakEntity, Window, div, px, AnyElement, App, IntoElement, ParentElement, SharedString, Styled, WeakEntity, Window, div, px,
relative, relative,
}; };
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::{ActiveTheme, Sizable, WindowExt, h_flex, v_flex}; use gpui_kit::component::{ActiveTheme, Sizable, WindowExt, h_flex, v_flex};
use nip29::{Group, GroupMetadata}; use nip29::{Group, GroupMetadata};
use ui::Avatar; use ui::Avatar;
@@ -137,7 +138,7 @@ fn header(group: &Group, cx: &App) -> AnyElement {
.child( .child(
div() div()
.text_sm() .text_sm()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.truncate() .truncate()
.child(group.display_name()), .child(group.display_name()),
) )
@@ -162,7 +163,7 @@ fn section(label: &'static str, content: AnyElement, cx: &App) -> AnyElement {
.child( .child(
div() div()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::MEDIUM) .font_medium()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(label), .child(label),
) )
+2 -1
View File
@@ -11,6 +11,7 @@ use gpui::{
list, px, list, px,
}; };
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariant, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariant, ButtonVariants};
use gpui_kit::component::dialog::DialogButtonProps; use gpui_kit::component::dialog::DialogButtonProps;
use gpui_kit::component::dock::{Panel, PanelEvent}; use gpui_kit::component::dock::{Panel, PanelEvent};
@@ -1126,7 +1127,7 @@ impl GroupPanel {
.flex_shrink_0() .flex_shrink_0()
.max_w(px(140.)) .max_w(px(140.))
.truncate() .truncate()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_color(cx.theme().foreground) .text_color(cx.theme().foreground)
.child(author), .child(author),
) )
+2 -1
View File
@@ -7,6 +7,7 @@ use gpui::{
WeakEntity, div, WeakEntity, div,
}; };
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::menu::{ContextMenuExt as _, PopupMenu, PopupMenuItem}; use gpui_kit::component::menu::{ContextMenuExt as _, PopupMenu, PopupMenuItem};
use gpui_kit::component::{ActiveTheme, Icon, Sizable, h_flex}; use gpui_kit::component::{ActiveTheme, Icon, Sizable, h_flex};
use nip29::{Activity, Group, Reaction}; use nip29::{Activity, Group, Reaction};
@@ -232,7 +233,7 @@ pub(crate) fn render_activity(
.min_w_0() .min_w_0()
.truncate() .truncate()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.child(subject.name()), .child(subject.name()),
) )
.child( .child(
+3 -2
View File
@@ -10,6 +10,7 @@ use gpui::{
App, AppContext, Context, Entity, EventEmitter, Global, IntoElement, ParentElement, App, AppContext, Context, Entity, EventEmitter, Global, IntoElement, ParentElement,
SharedString, Styled, Subscription, Task, Window, div, relative, SharedString, Styled, Subscription, Task, Window, div, relative,
}; };
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::Button; use gpui_kit::component::button::Button;
use gpui_kit::component::notification::{Notification, NotificationType}; use gpui_kit::component::notification::{Notification, NotificationType};
use gpui_kit::component::{ActiveTheme, Disableable, Sizable, WindowExt, h_flex, v_flex}; use gpui_kit::component::{ActiveTheme, Disableable, Sizable, WindowExt, h_flex, v_flex};
@@ -743,7 +744,7 @@ impl DeviceRegistry {
.text_xs() .text_xs()
.child( .child(
div() div()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_xs() .text_xs()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(SharedString::from("From:")), .child(SharedString::from("From:")),
@@ -773,7 +774,7 @@ impl DeviceRegistry {
.text_xs() .text_xs()
.child( .child(
div() div()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_xs() .text_xs()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(SharedString::from("Code:")), .child(SharedString::from("Code:")),
@@ -60,7 +60,6 @@ pub fn open(window: &mut Window, cx: &mut App) {
.icon(IconName::ArrowRight) .icon(IconName::ArrowRight)
.label("Join") .label("Join")
.primary() .primary()
.font_weight(gpui::FontWeight::SEMIBOLD)
.on_click({ .on_click({
let join = join.clone(); let join = join.clone();
move |event, window, cx| { move |event, window, cx| {
-1
View File
@@ -450,7 +450,6 @@ impl Render for NewChat {
.icon(IconName::ArrowRight) .icon(IconName::ArrowRight)
.label("Start") .label("Start")
.primary() .primary()
.font_weight(gpui::FontWeight::SEMIBOLD)
.on_click(cx.listener(move |this, _event, window, cx| { .on_click(cx.listener(move |this, _event, window, cx| {
if this.start_chat(window, cx) { if this.start_chat(window, cx) {
window.close_dialog(cx); window.close_dialog(cx);
+2 -2
View File
@@ -7,6 +7,7 @@ use gpui::{
}; };
use gpui_base::{Popup, Select}; use gpui_base::{Popup, Select};
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::dock::{DockArea, DockPlacement, PanelHandle}; use gpui_kit::component::dock::{DockArea, DockPlacement, PanelHandle};
use gpui_kit::component::form::field; use gpui_kit::component::form::field;
@@ -641,7 +642,6 @@ impl Render for NewGroup {
"Create Group" "Create Group"
}) })
.primary() .primary()
.font_weight(gpui::FontWeight::SEMIBOLD)
.loading(self.creating) .loading(self.creating)
.disabled(self.creating || self.uploading) .disabled(self.creating || self.uploading)
.on_click(cx.listener(|this, _event, _window, cx| this.create(cx))), .on_click(cx.listener(|this, _event, _window, cx| this.create(cx))),
@@ -658,7 +658,7 @@ fn field_label(text: &'static str, cx: &App) -> Div {
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.child(text) .child(text)
} }
+2 -4
View File
@@ -8,6 +8,7 @@ use gpui::{
PathPromptOptions, Render, SharedString, Styled, Task, Window, div, retain_all, PathPromptOptions, Render, SharedString, Styled, Task, Window, div, retain_all,
}; };
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::dock::DockPlacement; use gpui_kit::component::dock::DockPlacement;
use gpui_kit::component::input::{Input, InputState, Textarea, TextareaState}; use gpui_kit::component::input::{Input, InputState, Textarea, TextareaState};
@@ -486,7 +487,6 @@ impl Render for ProfileDialog {
.icon(IconName::SquarePen) .icon(IconName::SquarePen)
.label("Update") .label("Update")
.primary() .primary()
.font_weight(gpui::FontWeight::SEMIBOLD)
.on_click(cx.listener(move |this, _ev, window, cx| { .on_click(cx.listener(move |this, _ev, window, cx| {
this.toggle_edit(window, cx); this.toggle_edit(window, cx);
})), })),
@@ -498,7 +498,6 @@ impl Render for ProfileDialog {
.icon(IconName::MessageSquare) .icon(IconName::MessageSquare)
.label("Message") .label("Message")
.primary() .primary()
.font_weight(gpui::FontWeight::SEMIBOLD)
.on_click(cx.listener(move |this, _ev, window, cx| { .on_click(cx.listener(move |this, _ev, window, cx| {
this.message(window, cx); this.message(window, cx);
})), })),
@@ -519,7 +518,6 @@ impl Render for ProfileDialog {
.icon(IconName::CircleCheck) .icon(IconName::CircleCheck)
.label("Save") .label("Save")
.primary() .primary()
.font_weight(gpui::FontWeight::SEMIBOLD)
.loading(self.updating) .loading(self.updating)
.disabled(self.updating) .disabled(self.updating)
.on_click(cx.listener(move |this, _ev, window, cx| { .on_click(cx.listener(move |this, _ev, window, cx| {
@@ -535,7 +533,7 @@ fn label(label: &'static str, cx: &App) -> Div {
div() div()
.text_xs() .text_xs()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.child(label) .child(label)
} }
-1
View File
@@ -286,7 +286,6 @@ impl RelayManager {
.icon(IconName::ArrowRight) .icon(IconName::ArrowRight)
.label("Update") .label("Update")
.primary() .primary()
.font_weight(gpui::FontWeight::SEMIBOLD)
.loading(updating) .loading(updating)
.disabled(updating) .disabled(updating)
.on_click(cx.listener(move |this, _ev, window, cx| { .on_click(cx.listener(move |this, _ev, window, cx| {
-1
View File
@@ -115,7 +115,6 @@ impl Render for RestoreEncryption {
.icon(IconName::ArrowRight) .icon(IconName::ArrowRight)
.label("Restore") .label("Restore")
.primary() .primary()
.font_weight(gpui::FontWeight::SEMIBOLD)
.on_click(cx.listener(move |this, _, window, cx| { .on_click(cx.listener(move |this, _, window, cx| {
this.restore(window, cx); this.restore(window, cx);
})), })),
+2 -1
View File
@@ -8,6 +8,7 @@ use gpui::{
SharedString, Styled, Subscription, Task, Window, div, px, relative, uniform_list, SharedString, Styled, Subscription, Task, Window, div, px, relative, uniform_list,
}; };
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::spinner::Spinner; use gpui_kit::component::spinner::Spinner;
use gpui_kit::component::{ActiveTheme, Disableable, Icon, Sizable, WindowExt, h_flex, v_flex}; use gpui_kit::component::{ActiveTheme, Disableable, Icon, Sizable, WindowExt, h_flex, v_flex};
@@ -376,7 +377,7 @@ impl Render for Screening {
) )
.child( .child(
div() div()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.line_height(relative(1.25)) .line_height(relative(1.25))
.child(profile.name()), .child(profile.name()),
), ),
+4 -7
View File
@@ -1,5 +1,6 @@
use std::sync::Arc; use std::sync::Arc;
use ::settings::{AppSettings, AppearanceMode};
use anyhow::Error; use anyhow::Error;
use auto_update::AutoUpdater; use auto_update::AutoUpdater;
use chat::{ChatEvent, ChatRegistry}; use chat::{ChatEvent, ChatRegistry};
@@ -11,7 +12,7 @@ use gpui::{
use gpui_kit::component::button::Button; use gpui_kit::component::button::Button;
use gpui_kit::component::dock::{DockArea, DockLayout, DockPlacement, Panel, PanelHandle}; use gpui_kit::component::dock::{DockArea, DockLayout, DockPlacement, Panel, PanelHandle};
use gpui_kit::component::notification::{Notification, NotificationType}; use gpui_kit::component::notification::{Notification, NotificationType};
use gpui_kit::component::{ActiveTheme, WindowExt, v_flex}; use gpui_kit::component::{ActiveTheme, Theme, WindowExt, v_flex};
use nip4e::{DeviceEvent, DeviceRegistry}; use nip4e::{DeviceEvent, DeviceRegistry};
use nip29::{GroupId, GroupKey}; use nip29::{GroupId, GroupKey};
use nostr_sdk::prelude::*; use nostr_sdk::prelude::*;
@@ -88,13 +89,9 @@ impl Workspace {
let workspace = cx.entity().downgrade(); let workspace = cx.entity().downgrade();
let mut subscriptions = smallvec![]; let mut subscriptions = smallvec![];
// Follow OS appearance changes only when the user has not pinned a if AppSettings::get_appearance_mode(cx) == AppearanceMode::System {
// mode; the native-theme watcher drives runtime changes either way.
// The `::settings` path is the external crate; the crate-local
// `settings` module is the preferences dialog.
if ::settings::AppSettings::get_appearance_mode(cx) == ::settings::AppearanceMode::System {
subscriptions.push(cx.observe_window_appearance(window, |_this, window, cx| { subscriptions.push(cx.observe_window_appearance(window, |_this, window, cx| {
gpui_kit::component::Theme::sync_system_appearance(Some(window), cx); Theme::sync_system_appearance(Some(window), cx);
})); }));
} }
+3 -3
View File
@@ -4,6 +4,7 @@ use gpui::{
IntoElement, ParentElement, Render, SharedString, Styled, Task, Window, div, IntoElement, ParentElement, Render, SharedString, Styled, Task, Window, div,
}; };
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::dock::{Panel, PanelEvent}; use gpui_kit::component::dock::{Panel, PanelEvent};
use gpui_kit::component::input::{Input, InputState}; use gpui_kit::component::input::{Input, InputState};
@@ -153,7 +154,7 @@ impl Render for BackupPanel {
.child( .child(
div() div()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(SharedString::from("Public Key:")), .child(SharedString::from("Public Key:")),
) )
@@ -166,7 +167,7 @@ impl Render for BackupPanel {
.child( .child(
div() div()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(SharedString::from("Secret Key:")), .child(SharedString::from("Secret Key:")),
) )
@@ -184,7 +185,6 @@ impl Render for BackupPanel {
}) })
.primary() .primary()
.small() .small()
.font_weight(gpui::FontWeight::SEMIBOLD)
.on_click(cx.listener(move |this, _ev, _window, cx| { .on_click(cx.listener(move |this, _ev, _window, cx| {
this.copy_secret(cx); this.copy_secret(cx);
})), })),
+3 -2
View File
@@ -10,6 +10,7 @@ use gpui::{
}; };
use gpui_base::{VirtualListScrollHandle, v_virtual_list}; use gpui_base::{VirtualListScrollHandle, v_virtual_list};
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::dock::{DockArea, DockPlacement, Panel, PanelEvent, PanelHandle}; use gpui_kit::component::dock::{DockArea, DockPlacement, Panel, PanelEvent, PanelHandle};
use gpui_kit::component::input::{Input, InputEvent, InputState}; use gpui_kit::component::input::{Input, InputEvent, InputState};
@@ -269,7 +270,7 @@ impl BrowsePanel {
.child( .child(
div() div()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.line_height(relative(1.2)) .line_height(relative(1.2))
.child("Public Groups"), .child("Public Groups"),
) )
@@ -402,7 +403,7 @@ impl BrowsePanel {
div() div()
.text_xs() .text_xs()
.truncate() .truncate()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.line_height(relative(1.2)) .line_height(relative(1.2))
.child(name), .child(name),
) )
+2 -2
View File
@@ -8,6 +8,7 @@ use gpui::{
Window, div, rems, retain_all, Window, div, rems, retain_all,
}; };
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::dock::{Panel, PanelEvent}; use gpui_kit::component::dock::{Panel, PanelEvent};
use gpui_kit::component::input::{Input, InputEvent, InputState}; use gpui_kit::component::input::{Input, InputEvent, InputState};
@@ -325,7 +326,7 @@ impl Render for ContactListPanel {
.child( .child(
div() div()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child("New contact:"), .child("New contact:"),
) )
@@ -376,7 +377,6 @@ impl Render for ContactListPanel {
.icon(IconName::CircleCheck) .icon(IconName::CircleCheck)
.label("Update") .label("Update")
.primary() .primary()
.font_weight(gpui::FontWeight::SEMIBOLD)
.loading(self.updating) .loading(self.updating)
.disabled(self.updating) .disabled(self.updating)
.on_click(cx.listener(move |this, _ev, window, cx| { .on_click(cx.listener(move |this, _ev, window, cx| {
+2 -1
View File
@@ -10,6 +10,7 @@ use gpui::{
StatefulInteractiveElement, Styled, Subscription, Task, WeakEntity, Window, div, svg, StatefulInteractiveElement, Styled, Subscription, Task, WeakEntity, Window, div, svg,
}; };
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::dock::{DockArea, DockPlacement, Panel, PanelEvent, PanelHandle}; use gpui_kit::component::dock::{DockArea, DockPlacement, Panel, PanelEvent, PanelHandle};
use gpui_kit::component::group_box::{GroupBox, GroupBoxVariants}; use gpui_kit::component::group_box::{GroupBox, GroupBoxVariants};
@@ -424,7 +425,7 @@ impl GreeterPanel {
div() div()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.child("Find new friends"), .child("Find new friends"),
) )
.child( .child(
+3 -3
View File
@@ -165,7 +165,7 @@ impl Sidebar {
.text_xs() .text_xs()
.truncate() .truncate()
.line_height(relative(1.2)) .line_height(relative(1.2))
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.child(name), .child(name),
) )
.child( .child(
@@ -250,7 +250,7 @@ impl Sidebar {
.text_color(cx.theme().muted_foreground), .text_color(cx.theme().muted_foreground),
) )
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.on_click(cx.listener(move |this, _event, _window, cx| { .on_click(cx.listener(move |this, _event, _window, cx| {
match section { match section {
@@ -286,7 +286,7 @@ impl Sidebar {
let nav = Nav::new(public_key.to_hex()) let nav = Nav::new(public_key.to_hex())
.label(person.name()) .label(person.name())
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::MEDIUM) .font_medium()
.clickable(true) .clickable(true)
.when(!hide_avatar, |this| { .when(!hide_avatar, |this| {
this.prefix( this.prefix(
+2 -1
View File
@@ -4,6 +4,7 @@ use gpui::{
AnyElement, App, AppContext, Context, IntoElement, ParentElement, SharedString, Styled, Task, AnyElement, App, AppContext, Context, IntoElement, ParentElement, SharedString, Styled, Task,
Window, div, Window, div,
}; };
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants}; use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::dock::{DockPlacement, PanelHandle}; use gpui_kit::component::dock::{DockPlacement, PanelHandle};
use gpui_kit::component::notification::Notification; use gpui_kit::component::notification::Notification;
@@ -215,7 +216,7 @@ impl Sidebar {
.child("Selected") .child("Selected")
.child( .child(
div() div()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.child(SharedString::from(self.selected_contacts.len().to_string())), .child(SharedString::from(self.selected_contacts.len().to_string())),
), ),
) )
+8 -6
View File
@@ -8,7 +8,7 @@ use gpui::{
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _; use gpui_kit::base::StyledExt as _;
use gpui_kit::component::scroll::Scrollbar; use gpui_kit::component::scroll::Scrollbar;
use gpui_kit::component::{ActiveTheme, Icon, Sizable, h_flex, v_flex}; use gpui_kit::component::{ActiveTheme, Icon, h_flex, v_flex};
use nip29::GroupsRegistry; use nip29::GroupsRegistry;
use settings::AppSettings; use settings::AppSettings;
@@ -65,19 +65,20 @@ impl Sidebar {
.child( .child(
v_flex() v_flex()
.px_2() .px_2()
.gap_1()
.child( .child(
Nav::new("browse") Nav::new("browse")
.prefix(Icon::new(IconName::Compass).small()) .prefix(Icon::new(IconName::Compass))
.label("Browse") .label("Browse")
.text_sm()
.on_click(|_, window, cx| { .on_click(|_, window, cx| {
window.dispatch_action(Box::new(Command::ShowBrowse), cx) window.dispatch_action(Box::new(Command::ShowBrowse), cx)
}), }),
) )
.child( .child(
Nav::new("reqs") Nav::new("reqs")
.prefix(Icon::new(IconName::UserRoundPlus).small()) .prefix(Icon::new(IconName::UserRoundPlus))
.label("Requests") .label("Requests")
.text_sm()
.when(request_count > 0, |this| { .when(request_count > 0, |this| {
this.suffix( this.suffix(
h_flex() h_flex()
@@ -116,8 +117,9 @@ impl Sidebar {
) )
.child( .child(
Nav::new("contacts") Nav::new("contacts")
.prefix(Icon::new(IconName::Book).small()) .prefix(Icon::new(IconName::Book))
.label("Contacts") .label("Contacts")
.text_sm()
.when(contacts_open, |this| this.bg(cx.theme().list_active)) .when(contacts_open, |this| this.bg(cx.theme().list_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);
@@ -129,7 +131,7 @@ impl Sidebar {
div() div()
.px_4() .px_4()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(list_title), .child(list_title),
) )
+2 -1
View File
@@ -9,6 +9,7 @@ use gpui::{
IntoElement, ObjectFit, ParentElement, Render, SharedString, Styled, StyledImage, Subscription, IntoElement, ObjectFit, ParentElement, Render, SharedString, Styled, StyledImage, Subscription,
Task, UniformListScrollHandle, WeakEntity, Window, div, img, retain_all, Task, UniformListScrollHandle, WeakEntity, Window, div, img, retain_all,
}; };
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::dock::{DockArea, Panel, PanelEvent}; use gpui_kit::component::dock::{DockArea, Panel, PanelEvent};
use gpui_kit::component::input::{InputEvent, InputState}; use gpui_kit::component::input::{InputEvent, InputState};
use gpui_kit::component::notification::Notification; use gpui_kit::component::notification::Notification;
@@ -367,7 +368,7 @@ impl Render for Sidebar {
.when(cx.theme().shadow, |this| this.shadow_md()) .when(cx.theme().shadow, |this| this.shadow_md())
.rounded_full() .rounded_full()
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(Spinner::new().small().color(cx.theme().primary)) .child(Spinner::new().small().color(cx.theme().primary))
.child("Getting messages..."), .child("Getting messages..."),
@@ -38,7 +38,6 @@ pub(super) fn render_signed_out(_window: &mut Window, cx: &mut App) -> AnyElemen
.active(gpui::white().opacity(0.8)), .active(gpui::white().opacity(0.8)),
) )
.large() .large()
.font_weight(gpui::FontWeight::SEMIBOLD)
.on_click(|_, window, cx| { .on_click(|_, window, cx| {
import::open(window, cx); import::open(window, cx);
}), }),
+36 -35
View File
@@ -8,6 +8,7 @@ use gpui::{
SharedString, Styled, WeakEntity, Window, div, px, SharedString, Styled, WeakEntity, Window, div, px,
}; };
use gpui_kit::assets::IconName; use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::dialog::DialogButtonProps; use gpui_kit::component::dialog::DialogButtonProps;
use gpui_kit::component::dock::{ClosePanel, DockArea, DockPlacement, PanelHandle}; use gpui_kit::component::dock::{ClosePanel, DockArea, DockPlacement, PanelHandle};
use gpui_kit::component::menu::{ContextMenuExt as _, PopupMenuItem}; use gpui_kit::component::menu::{ContextMenuExt as _, PopupMenuItem};
@@ -59,6 +60,30 @@ pub(crate) fn open_room(
} }
} }
/// A row shown in the sidebar's lists.
pub(super) enum SidebarRow {
Section(ListSection),
Room {
room: Entity<Room>,
},
Group {
group: Entity<Group>,
},
Contact {
public_key: PublicKey,
},
/// A profile found by global search.
Profile {
public_key: PublicKey,
},
Message {
hit: MessageHit,
},
/// A non-interactive label, such as a search results section.
Heading(&'static str),
Empty(&'static str),
}
impl Sidebar { impl Sidebar {
pub(super) fn render_rows( pub(super) fn render_rows(
&self, &self,
@@ -100,7 +125,7 @@ impl Sidebar {
.text_color(cx.theme().muted_foreground), .text_color(cx.theme().muted_foreground),
) )
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.on_click(cx.listener(move |this, _event, _window, cx| { .on_click(cx.listener(move |this, _event, _window, cx| {
match section { match section {
@@ -122,7 +147,7 @@ impl Sidebar {
Nav::new(label) Nav::new(label)
.label(label) .label(label)
.text_xs() .text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD) .font_semibold()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.into_any_element() .into_any_element()
} }
@@ -160,7 +185,7 @@ impl Sidebar {
let nav = Nav::new(index) let nav = Nav::new(index)
.label(name) .label(name)
.text_xs() .text_sm()
.when(!hide_avatar, |this| { .when(!hide_avatar, |this| {
this.prefix( this.prefix(
Avatar::new(room.read(cx).display_image(cx)) Avatar::new(room.read(cx).display_image(cx))
@@ -185,7 +210,7 @@ impl Sidebar {
.when(!spam, |this| { .when(!spam, |this| {
this.child( this.child(
div() div()
.font_weight(gpui::FontWeight::NORMAL) .font_normal()
.text_xs() .text_xs()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(created_at), .child(created_at),
@@ -230,7 +255,7 @@ impl Sidebar {
Nav::new(index) Nav::new(index)
.label(person.name()) .label(person.name())
.text_xs() .text_sm()
.when(!hide_avatar, |this| { .when(!hide_avatar, |this| {
this.prefix( this.prefix(
Avatar::new(person.avatar()) Avatar::new(person.avatar())
@@ -254,7 +279,7 @@ impl Sidebar {
Nav::new(index) Nav::new(index)
.label(person.name()) .label(person.name())
.text_xs() .text_sm()
.when(!hide_avatar, |this| { .when(!hide_avatar, |this| {
this.prefix( this.prefix(
Avatar::new(person.avatar()) Avatar::new(person.avatar())
@@ -287,7 +312,7 @@ impl Sidebar {
let nav = Nav::new(index) let nav = Nav::new(index)
.label(name) .label(name)
.text_xs() .text_sm()
.when(!hide_avatar, |this| { .when(!hide_avatar, |this| {
this.prefix( this.prefix(
Avatar::new(group.read(cx).display_image()) Avatar::new(group.read(cx).display_image())
@@ -298,7 +323,7 @@ impl Sidebar {
.when_some(suffix, |this, suffix| { .when_some(suffix, |this, suffix| {
this.suffix( this.suffix(
div() div()
.font_weight(gpui::FontWeight::NORMAL) .font_normal()
.text_xs() .text_xs()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(suffix), .child(suffix),
@@ -360,8 +385,8 @@ impl Sidebar {
Nav::new(index) Nav::new(index)
.label(content) .label(content)
.text_xs() .text_sm()
.font_weight(gpui::FontWeight::MEDIUM) .font_medium()
.when(!hide_avatar, |this| { .when(!hide_avatar, |this| {
this.prefix( this.prefix(
Avatar::new(person.avatar()) Avatar::new(person.avatar())
@@ -371,7 +396,7 @@ impl Sidebar {
}) })
.suffix( .suffix(
div() div()
.font_weight(gpui::FontWeight::NORMAL) .font_normal()
.text_xs() .text_xs()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.child(detail), .child(detail),
@@ -386,27 +411,3 @@ impl Sidebar {
.collect() .collect()
} }
} }
/// A row shown in the sidebar's lists.
pub(super) enum SidebarRow {
Section(ListSection),
Room {
room: Entity<Room>,
},
Group {
group: Entity<Group>,
},
Contact {
public_key: PublicKey,
},
/// A profile found by global search.
Profile {
public_key: PublicKey,
},
Message {
hit: MessageHit,
},
/// A non-interactive label, such as a search results section.
Heading(&'static str),
Empty(&'static str),
}