diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index 44962288..e6e6c2f8 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -33,6 +33,7 @@ pub struct Checkbox { size: u16, spacing: u16, text_size: Option, + font: Renderer::Font, style: Renderer::Style, } @@ -61,6 +62,7 @@ impl size: ::DEFAULT_SIZE, spacing: Renderer::DEFAULT_SPACING, text_size: None, + font: Renderer::Font::default(), style: Renderer::Style::default(), } } @@ -97,6 +99,15 @@ impl self } + /// Sets the [`Font`] of the text of the [`Checkbox`]. + /// + /// [`Checkbox`]: struct.Checkbox.html + /// [`Font`]: ../../struct.Font.html + pub fn font(mut self, font: Renderer::Font) -> Self { + self.font = font; + self + } + /// Sets the style of the [`Checkbox`]. /// /// [`Checkbox`]: struct.Checkbox.html @@ -182,7 +193,7 @@ where label_layout.bounds(), &self.label, self.text_size.unwrap_or(renderer.default_size()), - Default::default(), + self.font, None, HorizontalAlignment::Left, VerticalAlignment::Center,