forked from reya/gpui-native-kit
update
This commit is contained in:
@@ -83,11 +83,9 @@ impl RenderOnce for Badge {
|
||||
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
|
||||
let theme = cx.theme();
|
||||
let metrics = theme.sizes.resolve(self.size);
|
||||
let label_size = metrics.caption_size;
|
||||
let (background, foreground) = self.variant.tokens(theme);
|
||||
|
||||
// Counts read smaller than control labels, like every native badge.
|
||||
let label_size = metrics.text_size * 0.8;
|
||||
|
||||
h_flex()
|
||||
.flex_none()
|
||||
.justify_center()
|
||||
@@ -95,8 +93,7 @@ impl RenderOnce for Badge {
|
||||
.bg(background)
|
||||
.text_color(foreground)
|
||||
.text_size(label_size)
|
||||
.line_height(label_size * 1.25)
|
||||
.px(metrics.padding_x * 0.5)
|
||||
.px(metrics.dense_padding_x)
|
||||
.py_0p5()
|
||||
.child(self.label)
|
||||
.refine_style(&self.style)
|
||||
|
||||
Reference in New Issue
Block a user