diff options
author | 2024-09-04 21:42:11 +0200 | |
---|---|---|
committer | 2024-09-04 21:42:11 +0200 | |
commit | 6009420b57933ccf799f1b7eac8debab950cdd5e (patch) | |
tree | e6218826131a702e51adf3041a45871140bae0be /widget/src/radio.rs | |
parent | 8d826cc662554b337282e7c982383f5db428d7aa (diff) | |
parent | 3a70462a7232cc2b3a7cc3fe8d07f0c29cc578cc (diff) | |
download | iced-6009420b57933ccf799f1b7eac8debab950cdd5e.tar.gz iced-6009420b57933ccf799f1b7eac8debab950cdd5e.tar.bz2 iced-6009420b57933ccf799f1b7eac8debab950cdd5e.zip |
Merge pull request #2279 from nrjais/wrapping
Add `text::Wrapping` support
Diffstat (limited to '')
-rw-r--r-- | widget/src/radio.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/widget/src/radio.rs b/widget/src/radio.rs index 1b02f8ca..cfa961f3 100644 --- a/widget/src/radio.rs +++ b/widget/src/radio.rs @@ -82,6 +82,7 @@ where text_size: Option<Pixels>, text_line_height: text::LineHeight, text_shaping: text::Shaping, + text_wrapping: text::Wrapping, font: Option<Renderer::Font>, class: Theme::Class<'a>, } @@ -122,10 +123,11 @@ where label: label.into(), width: Length::Shrink, size: Self::DEFAULT_SIZE, - spacing: Self::DEFAULT_SPACING, //15 + spacing: Self::DEFAULT_SPACING, text_size: None, text_line_height: text::LineHeight::default(), - text_shaping: text::Shaping::Basic, + text_shaping: text::Shaping::default(), + text_wrapping: text::Wrapping::default(), font: None, class: Theme::default(), } @@ -170,6 +172,12 @@ where self } + /// Sets the [`text::Wrapping`] strategy of the [`Radio`] button. + pub fn text_wrapping(mut self, wrapping: text::Wrapping) -> Self { + self.text_wrapping = wrapping; + self + } + /// Sets the text font of the [`Radio`] button. pub fn font(mut self, font: impl Into<Renderer::Font>) -> Self { self.font = Some(font.into()); @@ -245,6 +253,7 @@ where alignment::Horizontal::Left, alignment::Vertical::Top, self.text_shaping, + self.text_wrapping, ) }, ) |