From 99216acdec7d586e91ceb8b1b00ceee9f13be549 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 6 Mar 2025 11:08:19 -0500 Subject: [PATCH] gpui: Rename `rounded_sm` to `rounded_xs` (#26221) This PR renames the `rounded_sm` style method to `rounded_xs`. This will allow us to add an additional step in the scale. Release Notes: - N/A --- crates/editor/src/code_context_menus.rs | 2 +- crates/editor/src/editor.rs | 2 +- crates/editor/src/element.rs | 4 ++-- crates/gpui/examples/image_loading.rs | 4 ++-- crates/gpui/src/window/prompts.rs | 2 +- crates/gpui_macros/src/styles.rs | 2 +- crates/markdown_preview/src/markdown_preview_view.rs | 2 +- crates/repl/src/notebook/cell.rs | 8 ++++---- crates/ui/src/components/keybinding.rs | 2 +- crates/ui/src/components/numeric_stepper.rs | 2 +- crates/ui/src/components/toggle.rs | 2 +- crates/zed/src/zed/migrate.rs | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/crates/editor/src/code_context_menus.rs b/crates/editor/src/code_context_menus.rs index 3155e6f346..4241576454 100644 --- a/crates/editor/src/code_context_menus.rs +++ b/crates/editor/src/code_context_menus.rs @@ -534,7 +534,7 @@ impl CompletionsMenu { }; let color_swatch = completion .color() - .map(|color| div().size_4().bg(color).rounded_sm()); + .map(|color| div().size_4().bg(color).rounded_xs()); div().min_w(px(280.)).max_w(px(540.)).child( ListItem::new(mat.candidate_id) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 0841a9fac5..6fd5591df7 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -1201,7 +1201,7 @@ impl Editor { .bg(cx.theme().colors().ghost_element_background) .hover(|style| style.bg(cx.theme().colors().ghost_element_hover)) .active(|style| style.bg(cx.theme().colors().ghost_element_active)) - .rounded_sm() + .rounded_xs() .size_full() .cursor_pointer() .child("⋯") diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index e868b75430..cc25ae2824 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1724,7 +1724,7 @@ impl EditorElement { .h(line_height) .w_full() .px_1() - .rounded_sm() + .rounded_xs() .opacity(opacity) .bg(severity_to_color(&diagnostic_to_render.severity) .color(cx) @@ -2741,7 +2741,7 @@ impl EditorElement { header.child( div() .hover(|style| style.bg(colors.element_selected)) - .rounded_sm() + .rounded_xs() .child( ButtonLike::new("toggle-buffer-fold") .style(ui::ButtonStyle::Transparent) diff --git a/crates/gpui/examples/image_loading.rs b/crates/gpui/examples/image_loading.rs index 5aeed16342..0ca27c07b4 100644 --- a/crates/gpui/examples/image_loading.rs +++ b/crates/gpui/examples/image_loading.rs @@ -69,7 +69,7 @@ struct ImageLoadingExample {} impl ImageLoadingExample { fn loading_element() -> impl IntoElement { - div().size_full().flex_none().p_0p5().rounded_sm().child( + div().size_full().flex_none().p_0p5().rounded_xs().child( div().size_full().with_animation( "loading-bg", Animation::new(Duration::from_secs(3)) @@ -89,7 +89,7 @@ impl ImageLoadingExample { .flex() .items_center() .justify_center() - .rounded_sm() + .rounded_xs() .text_sm() .text_color(fallback_color) .border_1() diff --git a/crates/gpui/src/window/prompts.rs b/crates/gpui/src/window/prompts.rs index 32a4c8d36b..3c52afc1b0 100644 --- a/crates/gpui/src/window/prompts.rs +++ b/crates/gpui/src/window/prompts.rs @@ -135,7 +135,7 @@ impl Render for FallbackPromptRenderer { .border_1() .border_color(opaque_grey(0.2, 0.5)) .mt_1() - .rounded_sm() + .rounded_xs() .cursor_pointer() .text_sm() .child(action.clone()) diff --git a/crates/gpui_macros/src/styles.rs b/crates/gpui_macros/src/styles.rs index b6f8806c05..cb134d4f36 100644 --- a/crates/gpui_macros/src/styles.rs +++ b/crates/gpui_macros/src/styles.rs @@ -1233,7 +1233,7 @@ fn corner_suffixes() -> Vec { doc_string_suffix: "0px", }, CornerStyleSuffix { - suffix: "sm", + suffix: "xs", radius_tokens: quote! { rems(0.125) }, doc_string_suffix: "2px (0.125rem)", }, diff --git a/crates/markdown_preview/src/markdown_preview_view.rs b/crates/markdown_preview/src/markdown_preview_view.rs index bcc674f612..b3760b0da5 100644 --- a/crates/markdown_preview/src/markdown_preview_view.rs +++ b/crates/markdown_preview/src/markdown_preview_view.rs @@ -229,7 +229,7 @@ impl MarkdownPreviewView { s.bg(cx.theme().colors().border_variant) } }) - .rounded_sm(); + .rounded_xs(); container.child( div() diff --git a/crates/repl/src/notebook/cell.rs b/crates/repl/src/notebook/cell.rs index d4df0f60f8..ed5b666e05 100644 --- a/crates/repl/src/notebook/cell.rs +++ b/crates/repl/src/notebook/cell.rs @@ -397,7 +397,7 @@ impl Render for MarkdownCell { h_flex() .w_full() .pr_6() - .rounded_sm() + .rounded_xs() .items_start() .gap(DynamicSpacing::Base08.rems(cx)) .bg(self.selected_bg_color(window, cx)) @@ -572,7 +572,7 @@ impl Render for CodeCell { h_flex() .w_full() .pr_6() - .rounded_sm() + .rounded_xs() .items_start() .gap(DynamicSpacing::Base08.rems(cx)) .bg(self.selected_bg_color(window, cx)) @@ -598,7 +598,7 @@ impl Render for CodeCell { h_flex() .w_full() .pr_6() - .rounded_sm() + .rounded_xs() .items_start() .gap(DynamicSpacing::Base08.rems(cx)) .bg(self.selected_bg_color(window, cx)) @@ -718,7 +718,7 @@ impl Render for RawCell { h_flex() .w_full() .pr_2() - .rounded_sm() + .rounded_xs() .items_start() .gap(DynamicSpacing::Base08.rems(cx)) .bg(self.selected_bg_color(window, cx)) diff --git a/crates/ui/src/components/keybinding.rs b/crates/ui/src/components/keybinding.rs index 13fb412e3b..1b048b6dbd 100644 --- a/crates/ui/src/components/keybinding.rs +++ b/crates/ui/src/components/keybinding.rs @@ -120,7 +120,7 @@ impl RenderOnce for KeyBinding { h_flex() .flex_none() .py_0p5() - .rounded_sm() + .rounded_xs() .text_color(cx.theme().colors().text_muted) .when(use_text, |el| { el.child( diff --git a/crates/ui/src/components/numeric_stepper.rs b/crates/ui/src/components/numeric_stepper.rs index d491732b85..2c611bde37 100644 --- a/crates/ui/src/components/numeric_stepper.rs +++ b/crates/ui/src/components/numeric_stepper.rs @@ -75,7 +75,7 @@ impl RenderOnce for NumericStepper { h_flex() .gap_1() .px_1() - .rounded_sm() + .rounded_xs() .bg(cx.theme().colors().editor_background) .child( IconButton::new("decrement", IconName::Dash) diff --git a/crates/ui/src/components/toggle.rs b/crates/ui/src/components/toggle.rs index 4ea7bd34cc..18c148d365 100644 --- a/crates/ui/src/components/toggle.rs +++ b/crates/ui/src/components/toggle.rs @@ -197,7 +197,7 @@ impl RenderOnce for Checkbox { .items_center() .m(DynamicSpacing::Base04.px(cx)) .size(DynamicSpacing::Base16.rems(cx)) - .rounded_sm() + .rounded_xs() .bg(bg_color) .border_1() .border_color(border_color) diff --git a/crates/zed/src/zed/migrate.rs b/crates/zed/src/zed/migrate.rs index cf4ae924cd..6660240eec 100644 --- a/crates/zed/src/zed/migrate.rs +++ b/crates/zed/src/zed/migrate.rs @@ -199,7 +199,7 @@ impl Render for MigrationBanner { div() .px_1() .bg(cx.theme().colors().background) - .rounded_sm() + .rounded_xs() .child( Label::new(backup_file_name) .buffer_font(cx)