Introduce text::Alignment with Justified support

This commit is contained in:
Héctor Ramón Jiménez 2025-03-11 02:25:44 +01:00
parent e45d4b5cb6
commit 0e4a392731
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
30 changed files with 227 additions and 195 deletions

View file

@ -93,7 +93,7 @@ pub struct Toggler<
size: f32,
text_size: Option<Pixels>,
text_line_height: text::LineHeight,
text_alignment: Option<alignment::Horizontal>,
text_alignment: text::Alignment,
text_shaping: text::Shaping,
text_wrapping: text::Wrapping,
spacing: f32,
@ -127,7 +127,7 @@ where
size: Self::DEFAULT_SIZE,
text_size: None,
text_line_height: text::LineHeight::default(),
text_alignment: None,
text_alignment: text::Alignment::Default,
text_shaping: text::Shaping::default(),
text_wrapping: text::Wrapping::default(),
spacing: Self::DEFAULT_SIZE / 2.0,
@ -197,9 +197,9 @@ where
/// Sets the horizontal alignment of the text of the [`Toggler`]
pub fn text_alignment(
mut self,
alignment: impl Into<alignment::Horizontal>,
alignment: impl Into<text::Alignment>,
) -> Self {
self.text_alignment = Some(alignment.into());
self.text_alignment = alignment.into();
self
}