Fix horizontal text alignment
This commit is contained in:
parent
35c0e14452
commit
179a34d37b
23 changed files with 141 additions and 67 deletions
|
|
@ -93,7 +93,7 @@ pub struct Toggler<
|
|||
size: f32,
|
||||
text_size: Option<Pixels>,
|
||||
text_line_height: text::LineHeight,
|
||||
text_alignment: alignment::Horizontal,
|
||||
text_alignment: Option<alignment::Horizontal>,
|
||||
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: alignment::Horizontal::Left,
|
||||
text_alignment: None,
|
||||
text_shaping: text::Shaping::default(),
|
||||
text_wrapping: text::Wrapping::default(),
|
||||
spacing: Self::DEFAULT_SIZE / 2.0,
|
||||
|
|
@ -195,8 +195,11 @@ where
|
|||
}
|
||||
|
||||
/// Sets the horizontal alignment of the text of the [`Toggler`]
|
||||
pub fn text_alignment(mut self, alignment: alignment::Horizontal) -> Self {
|
||||
self.text_alignment = alignment;
|
||||
pub fn text_alignment(
|
||||
mut self,
|
||||
alignment: impl Into<alignment::Horizontal>,
|
||||
) -> Self {
|
||||
self.text_alignment = Some(alignment.into());
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue