diff --git a/crates/ui/src/button.rs b/crates/ui/src/button.rs index 870739b8..09fa273c 100644 --- a/crates/ui/src/button.rs +++ b/crates/ui/src/button.rs @@ -1,5 +1,5 @@ use gpui::{ - div, prelude::FluentBuilder as _, ClickEvent, DefiniteLength, Div, ElementId, Hsla, + div, prelude::FluentBuilder as _, px, ClickEvent, DefiniteLength, Div, ElementId, Hsla, InteractiveElement, IntoElement, MouseButton, ParentElement, RenderOnce, SharedString, StatefulInteractiveElement as _, Styled, WindowContext, }; @@ -131,9 +131,9 @@ impl RenderOnce for Button { ButtonSize::Medium => this.px_4().py_2().h_8(), }) .map(|this| match self.rounded { - ButtonRounded::Small => this.rounded_sm(), - ButtonRounded::Medium => this.rounded_md(), - ButtonRounded::Large => this.rounded_lg(), + ButtonRounded::Small => this.rounded(px(cx.theme().radius * 0.5)), + ButtonRounded::Medium => this.rounded(px(cx.theme().radius)), + ButtonRounded::Large => this.rounded(px(cx.theme().radius * 2.0)), ButtonRounded::None => this.rounded_none(), }) .when(!self.disabled, |this| { diff --git a/crates/ui/src/dropdown.rs b/crates/ui/src/dropdown.rs index 09049758..3375a820 100644 --- a/crates/ui/src/dropdown.rs +++ b/crates/ui/src/dropdown.rs @@ -173,7 +173,7 @@ where .bg(cx.theme().background) .border_1() .border_color(cx.theme().input) - .rounded_sm() + .rounded(px(cx.theme().radius)) .shadow_sm() .px_3() .py_2() @@ -201,7 +201,7 @@ where .bg(cx.theme().background) .border_1() .border_color(cx.theme().input) - .rounded_sm() + .rounded(px(cx.theme().radius)) .shadow_md() .track_focus(&self.picker.focus_handle(cx)) .child(self.picker.clone()), diff --git a/crates/ui/src/input.rs b/crates/ui/src/input.rs index 7de22120..50f02b56 100644 --- a/crates/ui/src/input.rs +++ b/crates/ui/src/input.rs @@ -603,7 +603,7 @@ impl Render for TextInput { cx.theme().input }) .border_1() - .rounded_sm() + .rounded(px(cx.theme().radius)) .shadow_sm() .px_3() .bg(if self.disabled { diff --git a/crates/ui/src/theme.rs b/crates/ui/src/theme.rs index 1283550a..41e1fd53 100644 --- a/crates/ui/src/theme.rs +++ b/crates/ui/src/theme.rs @@ -240,6 +240,7 @@ impl From for Theme { mode: ThemeMode::Dark, transparent: Hsla::transparent_black(), font_size: 14.0, + radius: 4.0, title_bar_background: colors.title_bar_background, background: colors.background, foreground: colors.foreground, @@ -261,7 +262,6 @@ impl From for Theme { input: colors.input, ring: colors.ring, selection: colors.selection, - radius: 0.0, } } }