Struct ChipFace
pub struct ChipFace<'a> { /* private fields */ }Expand description
An immediate-mode chip for a canvas that lays out its own rows (a rail,
a curve, a toolbar): the Chip widget’s look with no layout node.
Size the rect from the face: ChipFace::height and
ChipFace::intrinsic_width. A rect narrower than that elides the label.
Implementations§
§impl<'a> ChipFace<'a>
impl<'a> ChipFace<'a>
pub fn new(rect: Rect, label: &'a str) -> ChipFace<'a>
A trailing chevron: the chip opens a menu of choices.
pub fn lead(self, lead: ChipLead) -> ChipFace<'a>
pub fn style(self, style: ChipStyle) -> ChipFace<'a>
pub fn selected(self, selected: bool) -> ChipFace<'a>
pub fn selected(self, selected: bool) -> ChipFace<'a>
The chosen one of a set of filter chips: a lift.
pub fn hovered(self, hovered: bool) -> ChipFace<'a>
pub fn removable(self, hovered: bool) -> ChipFace<'a>
pub fn removable(self, hovered: bool) -> ChipFace<'a>
A trailing × that removes the token; hovered raises its ink.
pub fn bare(self) -> ChipFace<'a>
pub fn bare(self) -> ChipFace<'a>
Only the lead and the label, for a chip that already sits inside something doing the containing (a lit sector, a row that is itself the selection), where a pill would read as a box inside a box.
pub fn opacity(self, opacity: f32) -> ChipFace<'a>
pub fn opacity(self, opacity: f32) -> ChipFace<'a>
Fade the whole chip for an entrance or exit transition.
pub fn height(theme: &Theme) -> f64
pub fn height(theme: &Theme) -> f64
The pill height in theme: the selector height, grown with the label.
pub fn intrinsic_width(
label: &str,
lead: ChipLead,
removable: bool,
text: &mut TextRenderer,
theme: &Theme,
) -> f64
pub fn intrinsic_width( label: &str, lead: ChipLead, removable: bool, text: &mut TextRenderer, theme: &Theme, ) -> f64
The narrowest pill that shows label and lead without eliding.
pub fn remove_rect(&self, theme: &Theme) -> Rect
pub fn remove_rect(&self, theme: &Theme) -> Rect
Where the × is painted, for the host’s remove hit-test.
pub fn paint( &self, scene: &mut Scene, transform: Affine, text_renderer: &mut TextRenderer, theme: &Theme, )
Auto Trait Implementations§
impl<'a> Freeze for ChipFace<'a>
impl<'a> RefUnwindSafe for ChipFace<'a>
impl<'a> Send for ChipFace<'a>
impl<'a> Sync for ChipFace<'a>
impl<'a> Unpin for ChipFace<'a>
impl<'a> UnsafeUnpin for ChipFace<'a>
impl<'a> UnwindSafe for ChipFace<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more