From b3c192a2e478e9f2a101aecb417e316ed6900a80 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 19 Jun 2020 00:08:28 +0200 Subject: Make default text size configurable in `Settings` --- native/src/widget/radio.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'native/src/widget/radio.rs') diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs index d07a9012..5b8d00e9 100644 --- a/native/src/widget/radio.rs +++ b/native/src/widget/radio.rs @@ -41,7 +41,7 @@ pub struct Radio { width: Length, size: u16, spacing: u16, - text_size: u16, + text_size: Option, style: Renderer::Style, } @@ -75,7 +75,7 @@ impl width: Length::Shrink, size: ::DEFAULT_SIZE, spacing: Renderer::DEFAULT_SPACING, //15 - text_size: ::DEFAULT_SIZE, + text_size: None, style: Renderer::Style::default(), } } @@ -108,7 +108,7 @@ impl /// /// [`Radio`]: struct.Radio.html pub fn text_size(mut self, text_size: u16) -> Self { - self.text_size = text_size; + self.text_size = Some(text_size); self } @@ -151,7 +151,7 @@ where .push( Text::new(&self.label) .width(self.width) - .size(self.text_size), + .size(self.text_size.unwrap_or(renderer.default_size())), ) .layout(renderer, limits) } @@ -194,7 +194,7 @@ where defaults, label_layout.bounds(), &self.label, - self.text_size, + self.text_size.unwrap_or(renderer.default_size()), Default::default(), None, HorizontalAlignment::Left, -- cgit