Expand description
Class of text drawn
Themes choose font, font size, colour, and alignment based on this.
Variants
Label(bool)
Label text is drawn over the background colour
This takes one parameter: multi_line. Text is wrapped only if true.
LabelScroll
Scrollable label
This is similar to Label(true), but may occupy less vertical space.
Usually it also implies that the text is both scrollable and selectable,
but these are characteristics of the widget, not the text object.
AccelLabel(bool)
Label with accelerator keys
This takes one parameter: multi_line. Text is wrapped only if true.
This is identical to Label except that effects are only drawn if
accelerator-key mode is activated (usually the Alt key).
Button
Button text is drawn over a button
Same as AccelLabel(false), though theme may differentiate.
MenuLabel
Menu label (single line, does not stretch)
Similar to AccelLabel(false), but with horizontal stretching disabled.
Edit(bool)
Editable text, usually encapsulated in some type of box
This takes one parameter: multi_line. Text is wrapped only if true.
Implementations
sourceimpl TextClass
impl TextClass
sourcepub fn single_line(self) -> bool
pub fn single_line(self) -> bool
True if text is single-line only
sourcepub fn multi_line(self) -> bool
pub fn multi_line(self) -> bool
True if text is multi-line and should automatically line-wrap
Trait Implementations
sourceimpl<'de> Deserialize<'de> for TextClass
impl<'de> Deserialize<'de> for TextClass
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for TextClass
impl Ord for TextClass
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<TextClass> for TextClass
impl PartialEq<TextClass> for TextClass
sourceimpl PartialOrd<TextClass> for TextClass
impl PartialOrd<TextClass> for TextClass
sourcefn partial_cmp(&self, other: &TextClass) -> Option<Ordering>
fn partial_cmp(&self, other: &TextClass) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for TextClass
impl Eq for TextClass
impl StructuralEq for TextClass
impl StructuralPartialEq for TextClass
Auto Trait Implementations
impl RefUnwindSafe for TextClass
impl Send for TextClass
impl Sync for TextClass
impl Unpin for TextClass
impl UnwindSafe for TextClass
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
sourcefn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Try approximate conversion from Self to T Read more
sourcefn cast_approx(self) -> T
fn cast_approx(self) -> T
Cast approximately from Self to T Read more
sourceimpl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
sourcefn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
sourcefn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
sourcefn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
sourcefn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
sourcefn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
sourcefn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
sourcefn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.