forked from reya/gpui-native-kit
add StyledExt::refine_style to utils
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user