Struct StatusClusterFace
pub struct StatusClusterFace<'a> { /* private fields */ }Expand description
One slot’s drawing, as a bar control’s glyph.
Implementations§
§impl<'a> StatusClusterFace<'a>
impl<'a> StatusClusterFace<'a>
pub fn new(
slots: &'a [StatusSlot],
status: StatusCluster,
) -> StatusClusterFace<'a>
pub fn new( slots: &'a [StatusSlot], status: StatusCluster, ) -> StatusClusterFace<'a>
The cluster of slots, at the battery reading it shares.
pub fn at_height(self, height: f64) -> StatusClusterFace<'a>
pub fn at_height(self, height: f64) -> StatusClusterFace<'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 (the desktop’s is 24) keeps one top and bottom
edge across every control.
pub fn open(self, open: bool) -> StatusClusterFace<'a>
pub fn hovered(self, hovered: bool) -> StatusClusterFace<'a>
pub fn pressed(self, pressed: bool) -> StatusClusterFace<'a>
pub fn focused(self, focused: bool) -> StatusClusterFace<'a>
pub fn focused(self, focused: bool) -> StatusClusterFace<'a>
Keyboard focus; the ring shows only while focus is visible.
pub fn width(&self, text: &mut TextRenderer, theme: &Theme) -> f64
pub fn width(&self, text: &mut TextRenderer, theme: &Theme) -> f64
The cluster’s width: its pad each side, a square per slot, the bell’s room for a count beside it, and the battery’s percentage where it has a reading.
pub fn is_critical(&self) -> bool
pub fn is_critical(&self) -> bool
Whether the whole control should wear the danger wash: the battery is
at or under StatusCluster::CRITICAL.
pub fn paint(
&self,
ctx: &mut PaintCtx<'_>,
rect: Rect,
ground: AlphaColor<Srgb>,
) -> StatusClusterLayout
pub fn paint( &self, ctx: &mut PaintCtx<'_>, rect: Rect, ground: AlphaColor<Srgb>, ) -> StatusClusterLayout
Paint the cluster in rect (its width from Self::width) standing
on ground, and hand back where its parts landed.
Trait Implementations§
§impl<'a> Clone for StatusClusterFace<'a>
impl<'a> Clone for StatusClusterFace<'a>
§fn clone(&self) -> StatusClusterFace<'a>
fn clone(&self) -> StatusClusterFace<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<'a> Debug for StatusClusterFace<'a>
impl<'a> Debug for StatusClusterFace<'a>
impl<'a> Copy for StatusClusterFace<'a>
Auto Trait Implementations§
impl<'a> Freeze for StatusClusterFace<'a>
impl<'a> RefUnwindSafe for StatusClusterFace<'a>
impl<'a> Send for StatusClusterFace<'a>
impl<'a> Sync for StatusClusterFace<'a>
impl<'a> Unpin for StatusClusterFace<'a>
impl<'a> UnsafeUnpin for StatusClusterFace<'a>
impl<'a> UnwindSafe for StatusClusterFace<'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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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>
Converts
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>
Converts
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