Struct BarChipFace
pub struct BarChipFace<'a> { /* private fields */ }Expand description
One bar chip’s content and state, borrowed. Built by the caller each
frame; Self::paint draws it and hands back where its parts landed.
Implementations§
§impl<'a> BarChipFace<'a>
impl<'a> BarChipFace<'a>
pub fn new(name: &'a str, faces: &'a [Face<'a>]) -> BarChipFace<'a>
pub fn new(name: &'a str, faces: &'a [Face<'a>]) -> BarChipFace<'a>
A chip named name for assistive technology, standing for faces.
pub fn at_height(self, height: f64) -> BarChipFace<'a>
pub fn at_height(self, height: f64) -> BarChipFace<'a>
Paint and measure at height rather than the theme’s bar control
height: a bar whose own controls are a little shorter than the
toolkit’s default keeps one top and bottom edge across every control.
pub fn label(self, label: &'a str) -> BarChipFace<'a>
pub fn label(self, label: &'a str) -> BarChipFace<'a>
The words beside the faces. An empty string shows none; a chip with no faces and no label is its glyph alone.
pub fn overflow(self, overflow: usize) -> BarChipFace<'a>
pub fn overflow(self, overflow: usize) -> BarChipFace<'a>
How many people stand past the faces it shows.
pub fn icons(self, icons: &'a [Icon]) -> BarChipFace<'a>
pub fn icons(self, icons: &'a [Icon]) -> BarChipFace<'a>
The glyphs before the faces: a watch, an invitation, or a media pill’s microphone and camera. A chip with none starts its faces at its inset.
pub fn trailing(self, icon: Icon) -> BarChipFace<'a>
pub fn trailing(self, icon: Icon) -> BarChipFace<'a>
A trailing glyph: the chevron of a chip that opens a panel.
pub fn tone(self, tone: AlphaColor<Srgb>) -> BarChipFace<'a>
pub fn tone(self, tone: AlphaColor<Srgb>) -> BarChipFace<'a>
A status the chip means, washed into its body: a share that is live, a state that wants attention.
pub fn open(self, open: bool) -> BarChipFace<'a>
pub fn open(self, open: bool) -> BarChipFace<'a>
Its panel is open: it holds the whole lift.
pub fn hovered(self, hovered: bool) -> BarChipFace<'a>
pub fn pressed(self, pressed: bool) -> BarChipFace<'a>
pub fn focused(self, focused: bool) -> BarChipFace<'a>
pub fn focused(self, focused: bool) -> BarChipFace<'a>
Keyboard focus; the ring shows only while focus is visible.
pub fn label_width(self, width: f64) -> BarChipFace<'a>
pub fn label_width(self, width: f64) -> BarChipFace<'a>
The most the label may grow to before it elides.
pub fn width(&self, text: &mut TextRenderer, theme: &Theme) -> f64
pub fn width(&self, text: &mut TextRenderer, theme: &Theme) -> f64
The width the chip asks for its content: its pad each side, the icon, the face stack (whose rearmost face overlaps the gap), the label, and a trailing glyph, each a gap apart.
pub fn paint(
&self,
ctx: &mut PaintCtx<'_>,
rect: Rect,
ground: AlphaColor<Srgb>,
) -> BarChipLayout
pub fn paint( &self, ctx: &mut PaintCtx<'_>, rect: Rect, ground: AlphaColor<Srgb>, ) -> BarChipLayout
Paint the chip in rect (its width from Self::width, its height
Self::height) standing on ground.
Trait Implementations§
§impl<'a> Clone for BarChipFace<'a>
impl<'a> Clone for BarChipFace<'a>
§fn clone(&self) -> BarChipFace<'a>
fn clone(&self) -> BarChipFace<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<'a> Debug for BarChipFace<'a>
impl<'a> Debug for BarChipFace<'a>
impl<'a> Copy for BarChipFace<'a>
Auto Trait Implementations§
impl<'a> Freeze for BarChipFace<'a>
impl<'a> RefUnwindSafe for BarChipFace<'a>
impl<'a> Send for BarChipFace<'a>
impl<'a> Sync for BarChipFace<'a>
impl<'a> Unpin for BarChipFace<'a>
impl<'a> UnsafeUnpin for BarChipFace<'a>
impl<'a> UnwindSafe for BarChipFace<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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