core: remove sizing from badge

This commit is contained in:
2026-11-11 20:04:35 +07:00
parent d04c1038b8
commit faa81af9eb
2 changed files with 3 additions and 13 deletions
+2 -10
View File
@@ -9,7 +9,7 @@ use gpui::{
use gpui_native_icons::Icon;
use gpui_native_theme::{ActiveTheme as _, Size, Theme};
use crate::common::{Sizable, StyledExt, h_flex};
use crate::common::{StyledExt, h_flex};
/// The tooltip view builder gpui's `.tooltip(...)` expects.
type TooltipBuilder = Rc<dyn Fn(&mut Window, &mut App) -> AnyView>;
@@ -77,7 +77,6 @@ pub struct Badge {
label: SharedString,
icon: Option<Icon>,
variant: BadgeVariant,
size: Size,
tooltip: Option<TooltipBuilder>,
style: StyleRefinement,
}
@@ -94,7 +93,6 @@ impl Badge {
label: label.into(),
icon: None,
variant: BadgeVariant::default(),
size: Size::default(),
tooltip: None,
style: StyleRefinement::default(),
}
@@ -125,12 +123,6 @@ impl Badge {
}
}
impl Sizable for Badge {
fn apply_size(&mut self, size: Size) {
self.size = size;
}
}
impl gpui::Styled for Badge {
fn style(&mut self) -> &mut gpui::StyleRefinement {
&mut self.style
@@ -140,7 +132,7 @@ impl gpui::Styled for Badge {
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 metrics = theme.sizes.resolve(Size::Small);
let label_size = metrics.caption_size;
let (background, foreground, border) = self.variant.tokens(theme);