From ec2c70e90f4e43452b74b4798cbcc5001647f662 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 12 Nov 2026 05:36:57 +0000 Subject: [PATCH] ChipField: the remove mark sits inside the chip's pill, at its end (Badge end_mark) --- crates/ui-widgets/src/display/badge.rs | 26 ++++++++++++--- crates/ui-widgets/src/text/chips.rs | 41 +++++++++--------------- crates/ui-widgets/tests/it/text/chips.rs | 10 ++++++ 3 files changed, 46 insertions(+), 31 deletions(-) diff --git a/crates/ui-widgets/src/display/badge.rs b/crates/ui-widgets/src/display/badge.rs index 5e61b66fb..a092b617a 100644 --- a/crates/ui-widgets/src/display/badge.rs +++ b/crates/ui-widgets/src/display/badge.rs @@ -4,7 +4,7 @@ use crate::contract::{Common, Component, Cx, MeasureCx, PaintUi, Props as _, Rol use crate::primitives::{TextRun, Wrap}; use crate::runtime::env::Label; use crate::style::{ComponentStyle, StyleCx, SurfaceLook, TextLook, TypeRole}; -use craft_behavior::{Insets, Metrics, Sense}; +use craft_behavior::{Flow, Insets, Metrics, Sense}; use craft_theme::{ Variant, variant::{Emphasis, Tone}, @@ -61,12 +61,16 @@ pub struct Badge { /// The label in the muted text colour: what only some of a selection carries (a partial chip). #[prop(flag)] muted: bool, + /// The pill's end holds a square as high as the pill, in place of its end padding, for a mark the host draws over + /// it (a chip's remove button). + #[prop(flag)] + end_mark: bool, } impl Badge { /// A neutral, soft badge showing `label`, which is also its accessible name. pub fn new(label: impl Into