pub enum TextOverflow {
Clip,
Ellipsis,
Visible,
StartEllipsis,
MiddleEllipsis,
ScaleDown {
min_font_size_sp: f32,
},
}Expand description
How overflowing text should be handled.
Variants§
Clip
Text that does not fit is cut off at the bounds of the text.
Ellipsis
The end of the last visible line is replaced with an ellipsis.
Visible
Text is laid out in full and drawn beyond its bounds.
StartEllipsis
The start of the line is replaced with an ellipsis. Takes effect only when max_lines
is 1; otherwise no ellipsis is added.
MiddleEllipsis
The middle of the line is replaced with an ellipsis. Takes effect only when max_lines
is 1; otherwise no ellipsis is added.
ScaleDown
The font size shrinks until the text fits, down to min_font_size_sp. Text that
still overflows at that size is clipped.
Implementations§
Source§impl TextOverflow
impl TextOverflow
Sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
Returns the overflow with the ScaleDown minimum size raised to at least 1.0 sp.
Sourcepub fn scale_down_min_font_size_sp(self) -> Option<f32>
pub fn scale_down_min_font_size_sp(self) -> Option<f32>
Returns the minimum font size of ScaleDown in sp after normalizing, and None for
the other kinds.
Trait Implementations§
Source§impl Clone for TextOverflow
impl Clone for TextOverflow
impl Copy for TextOverflow
Source§impl Debug for TextOverflow
impl Debug for TextOverflow
Source§impl Default for TextOverflow
impl Default for TextOverflow
impl Eq for TextOverflow
Source§impl Hash for TextOverflow
impl Hash for TextOverflow
Auto Trait Implementations§
impl Freeze for TextOverflow
impl RefUnwindSafe for TextOverflow
impl Send for TextOverflow
impl Sync for TextOverflow
impl Unpin for TextOverflow
impl UnsafeUnpin for TextOverflow
impl UnwindSafe for TextOverflow
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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