summaryrefslogtreecommitdiffstats
path: root/widget/src/checkbox.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/checkbox.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 'widget/src/checkbox.rs')
-rw-r--r--widget/src/checkbox.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/widget/src/checkbox.rs b/widget/src/checkbox.rs
index e5abfbb4..32db5090 100644
--- a/widget/src/checkbox.rs
+++ b/widget/src/checkbox.rs
@@ -50,6 +50,7 @@ pub struct Checkbox<
text_size: Option<Pixels>,
text_line_height: text::LineHeight,
text_shaping: text::Shaping,
+ text_wrapping: text::Wrapping,
font: Option<Renderer::Font>,
icon: Icon<Renderer::Font>,
class: Theme::Class<'a>,
@@ -81,7 +82,8 @@ where
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,
icon: Icon {
font: Renderer::ICON_FONT,
@@ -158,6 +160,12 @@ where
self
}
+ /// Sets the [`text::Wrapping`] strategy of the [`Checkbox`].
+ pub fn text_wrapping(mut self, wrapping: text::Wrapping) -> Self {
+ self.text_wrapping = wrapping;
+ self
+ }
+
/// Sets the [`Renderer::Font`] of the text of the [`Checkbox`].
///
/// [`Renderer::Font`]: crate::core::text::Renderer
@@ -240,6 +248,7 @@ where
alignment::Horizontal::Left,
alignment::Vertical::Top,
self.text_shaping,
+ self.text_wrapping,
)
},
)
@@ -348,6 +357,7 @@ where
horizontal_alignment: alignment::Horizontal::Center,
vertical_alignment: alignment::Vertical::Center,
shaping: *shaping,
+ wrapping: text::Wrapping::default(),
},
bounds.center(),
style.icon_color,