Update Input, Button, Dropdown based on theme.radius
This commit is contained in:
parent
1a54a47ec8
commit
720672b0e2
4 changed files with 8 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
use gpui::{
|
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,
|
InteractiveElement, IntoElement, MouseButton, ParentElement, RenderOnce, SharedString,
|
||||||
StatefulInteractiveElement as _, Styled, WindowContext,
|
StatefulInteractiveElement as _, Styled, WindowContext,
|
||||||
};
|
};
|
||||||
|
|
@ -131,9 +131,9 @@ impl RenderOnce for Button {
|
||||||
ButtonSize::Medium => this.px_4().py_2().h_8(),
|
ButtonSize::Medium => this.px_4().py_2().h_8(),
|
||||||
})
|
})
|
||||||
.map(|this| match self.rounded {
|
.map(|this| match self.rounded {
|
||||||
ButtonRounded::Small => this.rounded_sm(),
|
ButtonRounded::Small => this.rounded(px(cx.theme().radius * 0.5)),
|
||||||
ButtonRounded::Medium => this.rounded_md(),
|
ButtonRounded::Medium => this.rounded(px(cx.theme().radius)),
|
||||||
ButtonRounded::Large => this.rounded_lg(),
|
ButtonRounded::Large => this.rounded(px(cx.theme().radius * 2.0)),
|
||||||
ButtonRounded::None => this.rounded_none(),
|
ButtonRounded::None => this.rounded_none(),
|
||||||
})
|
})
|
||||||
.when(!self.disabled, |this| {
|
.when(!self.disabled, |this| {
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ where
|
||||||
.bg(cx.theme().background)
|
.bg(cx.theme().background)
|
||||||
.border_1()
|
.border_1()
|
||||||
.border_color(cx.theme().input)
|
.border_color(cx.theme().input)
|
||||||
.rounded_sm()
|
.rounded(px(cx.theme().radius))
|
||||||
.shadow_sm()
|
.shadow_sm()
|
||||||
.px_3()
|
.px_3()
|
||||||
.py_2()
|
.py_2()
|
||||||
|
|
@ -201,7 +201,7 @@ where
|
||||||
.bg(cx.theme().background)
|
.bg(cx.theme().background)
|
||||||
.border_1()
|
.border_1()
|
||||||
.border_color(cx.theme().input)
|
.border_color(cx.theme().input)
|
||||||
.rounded_sm()
|
.rounded(px(cx.theme().radius))
|
||||||
.shadow_md()
|
.shadow_md()
|
||||||
.track_focus(&self.picker.focus_handle(cx))
|
.track_focus(&self.picker.focus_handle(cx))
|
||||||
.child(self.picker.clone()),
|
.child(self.picker.clone()),
|
||||||
|
|
|
||||||
|
|
@ -603,7 +603,7 @@ impl Render for TextInput {
|
||||||
cx.theme().input
|
cx.theme().input
|
||||||
})
|
})
|
||||||
.border_1()
|
.border_1()
|
||||||
.rounded_sm()
|
.rounded(px(cx.theme().radius))
|
||||||
.shadow_sm()
|
.shadow_sm()
|
||||||
.px_3()
|
.px_3()
|
||||||
.bg(if self.disabled {
|
.bg(if self.disabled {
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,7 @@ impl From<Colors> for Theme {
|
||||||
mode: ThemeMode::Dark,
|
mode: ThemeMode::Dark,
|
||||||
transparent: Hsla::transparent_black(),
|
transparent: Hsla::transparent_black(),
|
||||||
font_size: 14.0,
|
font_size: 14.0,
|
||||||
|
radius: 4.0,
|
||||||
title_bar_background: colors.title_bar_background,
|
title_bar_background: colors.title_bar_background,
|
||||||
background: colors.background,
|
background: colors.background,
|
||||||
foreground: colors.foreground,
|
foreground: colors.foreground,
|
||||||
|
|
@ -261,7 +262,6 @@ impl From<Colors> for Theme {
|
||||||
input: colors.input,
|
input: colors.input,
|
||||||
ring: colors.ring,
|
ring: colors.ring,
|
||||||
selection: colors.selection,
|
selection: colors.selection,
|
||||||
radius: 0.0,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue