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§
source§impl 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§
source§impl<'de> Deserialize<'de> for TextClass
impl<'de> Deserialize<'de> for TextClass
source§fn 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>,
source§impl Ord for TextClass
impl Ord for TextClass
source§impl PartialEq<TextClass> for TextClass
impl PartialEq<TextClass> for TextClass
source§impl PartialOrd<TextClass> for TextClass
impl PartialOrd<TextClass> for TextClass
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl 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§
source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.