add StyledExt::refine_style to utils

This commit is contained in:
2026-11-01 10:33:51 +07:00
parent 78d7e857f1
commit ac4a0f2add
6 changed files with 36 additions and 31 deletions
+6 -9
View File
@@ -1,10 +1,10 @@
use gpui::{
App, Hsla, IntoElement, ParentElement as _, Refineable as _, RenderOnce, SharedString,
StyleRefinement, Styled as _, Window,
App, Hsla, IntoElement, ParentElement as _, RenderOnce, SharedString, StyleRefinement,
Styled as _, Window,
};
use gpui_native_theme::{ActiveTheme as _, Size, Theme};
use crate::common::{Sizable, h_flex};
use crate::common::{Sizable, StyledExt, h_flex};
/// How loud a badge is.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
@@ -88,7 +88,7 @@ impl RenderOnce for Badge {
// Counts read smaller than control labels, like every native badge.
let label_size = metrics.text_size * 0.8;
let mut pill = h_flex()
h_flex()
.flex_none()
.justify_center()
.rounded(theme.radius.full)
@@ -98,10 +98,7 @@ impl RenderOnce for Badge {
.line_height(label_size * 1.25)
.px(metrics.padding_x * 0.5)
.py_0p5()
.child(self.label);
pill.style().refine(&self.style);
pill
.child(self.label)
.refine_style(&self.style)
}
}