diff options
author | 2020-06-19 00:08:28 +0200 | |
---|---|---|
committer | 2020-06-19 00:16:22 +0200 | |
commit | b3c192a2e478e9f2a101aecb417e316ed6900a80 (patch) | |
tree | aebde6403c3a6cef9566cca64e185272fcbbfcbd /native/src/widget/text.rs | |
parent | d19c02035ff5e4a895868023bd67f3df1f5d7007 (diff) | |
download | iced-b3c192a2e478e9f2a101aecb417e316ed6900a80.tar.gz iced-b3c192a2e478e9f2a101aecb417e316ed6900a80.tar.bz2 iced-b3c192a2e478e9f2a101aecb417e316ed6900a80.zip |
Make default text size configurable in `Settings`
Diffstat (limited to 'native/src/widget/text.rs')
-rw-r--r-- | native/src/widget/text.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/native/src/widget/text.rs b/native/src/widget/text.rs index 0b05b67d..48a69e34 100644 --- a/native/src/widget/text.rs +++ b/native/src/widget/text.rs @@ -131,7 +131,7 @@ where ) -> layout::Node { let limits = limits.width(self.width).height(self.height); - let size = self.size.unwrap_or(Renderer::DEFAULT_SIZE); + let size = self.size.unwrap_or(renderer.default_size()); let bounds = limits.max(); @@ -154,7 +154,7 @@ where defaults, layout.bounds(), &self.content, - self.size.unwrap_or(Renderer::DEFAULT_SIZE), + self.size.unwrap_or(renderer.default_size()), self.font, self.color, self.horizontal_alignment, @@ -187,10 +187,10 @@ pub trait Renderer: crate::Renderer { /// [`Text`]: struct.Text.html type Font: Default + Copy; - /// The default size of [`Text`]. + /// Returns the default size of [`Text`]. /// /// [`Text`]: struct.Text.html - const DEFAULT_SIZE: u16; + fn default_size(&self) -> u16; /// Measures the [`Text`] in the given bounds and returns the minimum /// boundaries that can fit the contents. |