pub enum TextClass {
Label(bool),
LabelScroll,
AccessLabel(bool),
Button,
MenuLabel,
Edit(bool),
}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.
AccessLabel(bool)
Label with access 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
access key mode is activated (usually the Alt key).
Button
Button text is drawn over a button
Same as AccessLabel(false), though theme may differentiate.
MenuLabel
Menu label (single line, does not stretch)
Similar to AccessLabel(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
Sourcepub fn is_access_key(self) -> bool
pub fn is_access_key(self) -> bool
True if text effects should only be shown dependant on access key mode being active
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 PartialOrd for TextClass
impl PartialOrd for TextClass
impl Copy for TextClass
impl Eq for TextClass
impl StructuralPartialEq for TextClass
Auto Trait Implementations§
impl Freeze for TextClass
impl RefUnwindSafe for TextClass
impl Send for TextClass
impl Sync for TextClass
impl Unpin for TextClass
impl UnwindSafe for TextClass
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<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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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