feat: add Ellipsize to widgets

This commit is contained in:
Hojjat 2026-02-19 09:27:37 -07:00 committed by Ashley Wulber
parent f2ef716ad5
commit cc670e1966
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
18 changed files with 181 additions and 9 deletions

View file

@ -5,6 +5,8 @@ use crate::text::{
};
use crate::{Pixels, Point, Rectangle, Size};
use super::Ellipsize;
/// A text paragraph.
pub trait Paragraph: Sized + Default {
/// The font of this [`Paragraph`].
@ -78,6 +80,10 @@ pub trait Paragraph: Sized + Default {
fn min_height(&self) -> f32 {
self.min_bounds().height
}
/// Returns the [`Ellipsize`] strategy of the [`Paragraph`]>
fn ellipsize(&self) -> Ellipsize;
}
/// A [`Paragraph`] of plain text.
@ -169,6 +175,7 @@ impl<P: Paragraph> Plain<P> {
align_y: self.raw.align_y(),
shaping: self.raw.shaping(),
wrapping: self.raw.wrapping(),
ellipsize: self.raw.ellipsize()
}
}
}