Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/ui/src/acp_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl Render for AcpAgentCard {
let agent = self.store.read(cx).installed_acp_agent(&self.agent_id);
v_flex()
.w_full()
.rounded(material::radius_card())
.rounded(material::radius_card(cx))
.bg(cx.theme().secondary)
.overflow_hidden()
.when_some(agent, |card, agent| {
Expand Down Expand Up @@ -500,7 +500,7 @@ impl AcpPanel {
.flex_1()
.min_h_0()
.relative()
.rounded(material::radius_card())
.rounded(material::radius_card(cx))
.bg(cx.theme().muted)
.child(rows)
.when(!window.is_inspector_picking(cx), |rows| {
Expand Down Expand Up @@ -549,7 +549,7 @@ impl AcpPanel {
.p_3()
.gap_3()
.items_center()
.rounded(material::radius_card())
.rounded(material::radius_card(cx))
.bg(cx.theme().muted)
.child(glyph.text_color(if enabled {
cx.theme().foreground
Expand Down Expand Up @@ -639,7 +639,7 @@ impl AcpPanel {
.id(id)
.px_3()
.py_1p5()
.rounded(material::radius_button())
.rounded(material::radius_button(cx))
.cursor_pointer()
.when(active, |s| s.bg(cx.theme().accent).font_medium())
.hover(|s| s.bg(cx.theme().accent))
Expand Down
18 changes: 9 additions & 9 deletions crates/ui/src/add_project_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub(super) fn open(store: Entity<WorkspaceStore>, window: &mut Window, cx: &mut
let dialog_content = content.clone();
builder
.w(px(680.))
.rounded(crate::material::radius_overlay())
.rounded(crate::material::radius_overlay(cx))
.bg(cx.theme().popover)
.border_1()
.border_color(cx.theme().border)
Expand Down Expand Up @@ -236,7 +236,7 @@ impl AddProjectDialog {
let progress_content = content.clone();
builder
.w(px(480.))
.rounded(crate::material::radius_overlay())
.rounded(crate::material::radius_overlay(cx))
.bg(cx.theme().popover)
.border_1()
.border_color(cx.theme().border)
Expand Down Expand Up @@ -299,7 +299,7 @@ impl AddProjectDialog {
.gap_1()
.px_3()
.py_2()
.rounded(crate::material::radius_card())
.rounded(crate::material::radius_card(cx))
.text_size(px(13.))
.cursor_pointer()
.hover(|style| style.bg(cx.theme().list_hover))
Expand Down Expand Up @@ -374,12 +374,12 @@ impl Render for AddProjectDialog {
.child(
Input::new(&self.path_input)
.flex_1()
.rounded(crate::material::radius_input()),
.rounded(crate::material::radius_input(cx)),
)
.when(can_browse, |row| {
row.child(
Button::new("browse-project-directory")
.rounded(crate::material::radius_button())
.rounded(crate::material::radius_button(cx))
.label(crate::tr!("sidebar.browse"))
.on_click(cx.listener(|dialog, _, window, cx| {
dialog.browse_clicked(window, cx);
Expand Down Expand Up @@ -515,7 +515,7 @@ impl Render for ImportProgress {
.child(
h_flex().w_full().justify_end().child(
Button::new("external-import-ok")
.rounded(crate::material::radius_button())
.rounded(crate::material::radius_button(cx))
.primary()
.label(crate::tr!("sidebar.import_ok"))
.on_click(move |_, window, cx| {
Expand All @@ -533,21 +533,21 @@ impl Render for ImportProgress {
fn render_add_footer(
dialog: &Entity<AddProjectDialog>,
_window: &mut Window,
_cx: &mut App,
cx: &mut App,
) -> AnyElement {
let open = dialog.clone();
DialogActions::new()
.child(
Button::new("add-project-cancel")
.rounded(crate::material::radius_button())
.rounded(crate::material::radius_button(cx))
.label(crate::tr!("sidebar.cancel"))
.on_click(move |_, window, cx| {
window.close_dialog(cx);
}),
)
.child(
Button::new("add-project-open")
.rounded(crate::material::radius_button())
.rounded(crate::material::radius_button(cx))
.primary()
.label(crate::tr!("sidebar.open"))
.on_click(move |_, window, cx| {
Expand Down
5 changes: 3 additions & 2 deletions crates/ui/src/attachments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ pub(crate) fn open_image_lightbox(
// Leave room for the dialog header, padding and bottom margin in short windows.
let max_h = (viewport.height * 0.75).min(viewport.height * 0.9 - px(96.));
let source = source.clone();
let image_radius = crate::material::radius_card(cx);
builder
.w(px(1200.))
.rounded(crate::material::radius_overlay())
.rounded(crate::material::radius_overlay(cx))
.bg(cx.theme().popover)
.border_1()
.border_color(cx.theme().border)
Expand All @@ -34,7 +35,7 @@ pub(crate) fn open_image_lightbox(
img(source.clone())
.max_w_full()
.max_h(max_h)
.rounded(crate::material::radius_card()),
.rounded(image_radius),
),
)
})
Expand Down
2 changes: 1 addition & 1 deletion crates/ui/src/chat/components/activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub(crate) fn activity_row(
move || format!("activity-row-{id}")
})
.aria_expanded(expanded)
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.cursor_pointer()
.hover(|row| row.bg(cx.theme().accent))
.on_click(on_toggle)
Expand Down
2 changes: 1 addition & 1 deletion crates/ui/src/chat/components/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub(crate) fn action_button(
Button::new(id.into())
.ghost()
.small()
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.icon(Icon::new(icon).text_color(cx.theme().muted_foreground))
.tooltip(label.into())
}
Expand Down
8 changes: 4 additions & 4 deletions crates/ui/src/chat/components/bubble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub(crate) fn native_rewind_button(
.disabled(disabled)
.when(compact, |button| button.min_w(px(44.)).min_h(px(44.)));
Some(
crate::material::overlay_popover(("rewind-menu", turn))
crate::material::overlay_popover(("rewind-menu", turn), cx)
.anchor(Anchor::TopRight)
.when(compact, |popover| {
popover.bottom_sheet(crate::tr!("chat.rewind"))
Expand Down Expand Up @@ -129,7 +129,7 @@ pub(crate) fn native_rewind_button(
.py_1p5()
.gap_2()
.items_center()
.rounded(px(6.))
.rounded(cx.theme().tokens.radius.sm)
.cursor_pointer()
.text_size(px(13.))
.hover(move |style| style.bg(accent))
Expand Down Expand Up @@ -248,7 +248,7 @@ pub(crate) fn user_bubble(
.mb(px(-2.))
.flex()
.items_center()
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.bg(cx.theme().muted)
.text_size(px(11.))
.text_color(cx.theme().muted_foreground)
Expand All @@ -268,7 +268,7 @@ pub(crate) fn user_bubble(
.max_w_3_4()
.px(px(10.))
.py(px(6.))
.rounded(px(12.))
.rounded(cx.theme().tokens.radius.lg)
.bg(cx.theme().foreground.opacity(0.08))
.when(pending, |bubble| {
bubble
Expand Down
6 changes: 3 additions & 3 deletions crates/ui/src/chat/components/changed_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub(crate) fn changed_files(
.px_2()
.gap_1()
.items_center()
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.border_1()
.border_color(cx.theme().border)
.bg(crate::material::content_surface(cx))
Expand Down Expand Up @@ -184,7 +184,7 @@ pub(crate) fn quiet_control(
.h(px(22.))
.px_1p5()
.items_center()
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.text_size(px(11.5))
.text_color(cx.theme().muted_foreground)
.cursor_pointer()
Expand Down Expand Up @@ -251,7 +251,7 @@ pub(crate) fn file_edit_row(
cx,
)
.aria_expanded(expanded)
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.cursor_pointer()
.hover(|header| header.bg(cx.theme().accent))
.on_click(on_toggle)
Expand Down
6 changes: 3 additions & 3 deletions crates/ui/src/chat/components/disclosure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub(crate) fn disclosure(
.px_1p5()
.gap_1p5()
.items_center()
.rounded(crate::material::radius_button())
.rounded(crate::material::radius_button(cx))
.text_size(px(11.))
.text_color(muted)
.cursor_pointer()
Expand Down Expand Up @@ -108,7 +108,7 @@ fn disclosure_body(key: &str, full_text: &str, cx: &App) -> Div {
let muted = cx.theme().muted_foreground;
div()
.w_full()
.rounded(crate::material::radius_card())
.rounded(crate::material::radius_card(cx))
.bg(cx.theme().muted)
// The card keeps clicks to itself, but a pan that its body cannot use
// must still reach the timeline behind it.
Expand Down Expand Up @@ -276,7 +276,7 @@ pub(crate) fn proposed_plan_card(
h_flex()
.w_full()
.items_stretch()
.rounded(crate::material::radius_card())
.rounded(crate::material::radius_card(cx))
.overflow_hidden()
.bg(cx.theme().muted.opacity(0.6))
.child(
Expand Down
2 changes: 1 addition & 1 deletion crates/ui/src/chat/components/error_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub(crate) fn error_card(
h_flex()
.w_full()
.items_stretch()
.rounded(crate::material::radius_card())
.rounded(crate::material::radius_card(cx))
.overflow_hidden()
.border_1()
.border_color(danger.opacity(0.22))
Expand Down
8 changes: 4 additions & 4 deletions crates/ui/src/chat/components/subagent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub(crate) fn subagent_row(
.px_2()
.gap_1()
.items_center()
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.bg(cx.theme().success.opacity(0.12))
.text_color(cx.theme().success)
.text_size(px(11.5))
Expand All @@ -77,7 +77,7 @@ pub(crate) fn subagent_row(
.px_2()
.gap_1()
.items_center()
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.bg(cx.theme().warning.opacity(0.12))
.text_color(cx.theme().warning)
.text_size(px(11.5))
Expand All @@ -93,7 +93,7 @@ pub(crate) fn subagent_row(
.px_2()
.gap_1()
.items_center()
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.bg(cx.theme().danger.opacity(0.12))
.text_color(cx.theme().danger)
.text_size(px(11.5))
Expand Down Expand Up @@ -124,7 +124,7 @@ pub(crate) fn subagent_row(
div()
.flex_none()
.px_2()
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.bg(cx.theme().muted.opacity(0.4))
.text_color(muted)
.font_family(cx.theme().mono_font_family.clone())
Expand Down
4 changes: 2 additions & 2 deletions crates/ui/src/chat/components/work_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub(crate) fn work_log(
.px_1p5()
.gap_1p5()
.items_center()
.rounded(crate::material::radius_button())
.rounded(crate::material::radius_button(cx))
.text_size(px(12.5))
.font_medium()
.text_color(muted)
Expand All @@ -102,7 +102,7 @@ pub(crate) fn work_log(
.px_2()
.gap_1()
.items_center()
.rounded(crate::material::radius_chip())
.rounded(crate::material::radius_chip(cx))
.bg(cx.theme().danger.opacity(0.12))
.text_color(cx.theme().danger)
.text_size(px(11.5))
Expand Down
20 changes: 10 additions & 10 deletions crates/ui/src/chat/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,7 @@ impl ChatView {
// ChatView entity (the popover content runs at App level, not in a view
// context, so `cx.listener` is unavailable here).
let chat = cx.entity();
let chevron = crate::material::overlay_popover("git-menu")
let chevron = crate::material::overlay_popover("git-menu", cx)
.anchor(Anchor::TopRight)
.trigger(
Button::new("git-menu-trigger")
Expand Down Expand Up @@ -2515,7 +2515,7 @@ impl ChatView {
.py_1p5()
.gap_2()
.items_center()
.rounded(px(6.))
.rounded(cx.theme().tokens.radius.sm)
.text_size(px(13.))
.child(git_action_icon(action).xsmall().text_color(muted))
.child(div().flex_1().child(label));
Expand Down Expand Up @@ -2548,7 +2548,7 @@ impl ChatView {
.flex_none()
.h(px(28.))
.items_center()
.rounded(px(8.))
.rounded(cx.theme().tokens.radius.md)
.border_1()
.border_color(border)
.overflow_hidden()
Expand Down Expand Up @@ -2606,7 +2606,7 @@ impl ChatView {
let main_cwd = cwd.clone();
let menu_cwd = cwd;

let chevron = crate::material::overlay_popover("open-menu")
let chevron = crate::material::overlay_popover("open-menu", cx)
.anchor(Anchor::TopRight)
.trigger(
Button::new("open-menu-trigger")
Expand All @@ -2632,7 +2632,7 @@ impl ChatView {
.py_1p5()
.gap_2()
.items_center()
.rounded(px(6.))
.rounded(cx.theme().tokens.radius.sm)
.cursor_pointer()
.text_size(px(13.))
.hover(move |s| s.bg(accent))
Expand Down Expand Up @@ -2688,7 +2688,7 @@ impl ChatView {
.h(px(28.))
.on_mouse_down(gpui::MouseButton::Left, |_, _, cx| cx.stop_propagation())
.items_center()
.rounded(px(8.))
.rounded(cx.theme().tokens.radius.md)
.border_1()
.border_color(border)
.overflow_hidden()
Expand Down Expand Up @@ -2853,7 +2853,7 @@ impl ChatView {
.items_center()
.gap_2()
.px_3()
.rounded(cx.theme().radius)
.rounded(cx.theme().tokens.radius.md)
.cursor_pointer()
.hover(|row| row.bg(cx.theme().accent))
.on_click(cx.listener(move |this, _, _, cx| {
Expand Down Expand Up @@ -2925,7 +2925,7 @@ impl ChatView {
// The outline button's bg is ~transparent; an opaque popover
// backing keeps the pill readable over the chat text below.
div()
.rounded(cx.theme().radius)
.rounded(cx.theme().tokens.radius.md)
.bg(cx.theme().popover)
.shadow_md()
.child(
Expand Down Expand Up @@ -3227,7 +3227,7 @@ impl Render for ChatView {
CONTENT_MIN_PADDING
}))
.when(this.highlighted_turn == Some(row.turn), |item| {
item.rounded(crate::material::radius_card())
item.rounded(crate::material::radius_card(cx))
.bg(cx.theme().list_active)
})
.when(index == 0, |item| item.pt(px(TIMELINE_EDGE_PADDING)))
Expand Down Expand Up @@ -3343,7 +3343,7 @@ impl Render for ChatView {
.px(px(10.))
.py(px(6.))
.text_size(px(15.))
.rounded(px(12.))
.rounded(cx.theme().tokens.radius.lg)
.bg(cx.theme().foreground.opacity(0.08))
.text_color(if acknowledged {
cx.theme().foreground
Expand Down
Loading
Loading