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 Ord for TextClass
impl Ord for TextClass
source§impl PartialEq for TextClass
impl PartialEq for TextClass
source§impl PartialOrd for TextClass
impl PartialOrd 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<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
§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
§fn cast_approx(self) -> T
fn cast_approx(self) -> T
§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
§fn cast_floor(self) -> T
fn cast_floor(self) -> T
§fn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
§fn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
§fn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
§fn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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>
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>
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)
&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)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.