Struct TextStackFace
pub struct TextStackFace<'a> { /* private fields */ }Expand description
A text stack’s lines, borrowed, and how to paint them.
Implementations§
§impl<'a> TextStackFace<'a>
impl<'a> TextStackFace<'a>
pub fn new(title: &'a str) -> TextStackFace<'a>
pub fn styled(
self,
title: &'a TextStyle,
caption: &'a TextStyle,
) -> TextStackFace<'a>
pub fn styled( self, title: &'a TextStyle, caption: &'a TextStyle, ) -> TextStackFace<'a>
Set the title and the caption lines in title and caption, for a
surface that scales its type itself.
pub fn secondary_tone(self, tone: Tone) -> TextStackFace<'a>
pub fn secondary_tone(self, tone: Tone) -> TextStackFace<'a>
The secondary line says a status (a playback error): it reads in
tone’s ink.
pub fn secondary(self, text: &'a str) -> TextStackFace<'a>
pub fn secondary(self, text: &'a str) -> TextStackFace<'a>
The secondary line. An empty string shows no line.
pub fn tertiary(self, text: &'a str) -> TextStackFace<'a>
pub fn tertiary(self, text: &'a str) -> TextStackFace<'a>
The tertiary line. An empty string shows no line.
pub fn dense(self) -> TextStackFace<'a>
pub fn dense(self) -> TextStackFace<'a>
A Label title, for a dense row or a bar.
pub fn height(&self, text: &mut TextRenderer, theme: &Theme) -> f64
pub fn height(&self, text: &mut TextRenderer, theme: &Theme) -> f64
The stack’s height: its lines and the gaps between them.
pub fn natural_width(&self, text: &mut TextRenderer, theme: &Theme) -> f64
pub fn natural_width(&self, text: &mut TextRenderer, theme: &Theme) -> f64
The widest line’s natural width.
pub fn title_centre(
&self,
rect: Rect,
text: &mut TextRenderer,
theme: &Theme,
) -> f64
pub fn title_centre( &self, rect: Rect, text: &mut TextRenderer, theme: &Theme, ) -> f64
The centre line of the title as Self::paint places it in
rect: what a leading icon beside a multi-line stack lines up with.
pub fn title_top(
&self,
rect: Rect,
text: &mut TextRenderer,
theme: &Theme,
) -> f64
pub fn title_top( &self, rect: Rect, text: &mut TextRenderer, theme: &Theme, ) -> f64
The baseline-side top of the title as Self::paint places it in
rect: where a quiet line beside the title starts.
Trait Implementations§
§impl<'a> Clone for TextStackFace<'a>
impl<'a> Clone for TextStackFace<'a>
§fn clone(&self) -> TextStackFace<'a>
fn clone(&self) -> TextStackFace<'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 TextStackFace<'a>
impl<'a> Debug for TextStackFace<'a>
impl<'a> Copy for TextStackFace<'a>
Auto Trait Implementations§
impl<'a> Freeze for TextStackFace<'a>
impl<'a> !RefUnwindSafe for TextStackFace<'a>
impl<'a> Send for TextStackFace<'a>
impl<'a> Sync for TextStackFace<'a>
impl<'a> Unpin for TextStackFace<'a>
impl<'a> UnsafeUnpin for TextStackFace<'a>
impl<'a> !UnwindSafe for TextStackFace<'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