summaryrefslogtreecommitdiffstats
path: root/widget/src/radio.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-09-04 21:42:11 +0200
committerLibravatar GitHub <noreply@github.com>2024-09-04 21:42:11 +0200
commit6009420b57933ccf799f1b7eac8debab950cdd5e (patch)
treee6218826131a702e51adf3041a45871140bae0be /widget/src/radio.rs
parent8d826cc662554b337282e7c982383f5db428d7aa (diff)
parent3a70462a7232cc2b3a7cc3fe8d07f0c29cc578cc (diff)
downloadiced-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.rs13
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,
)
},
)