diff options
author | 2020-02-18 02:28:15 +0100 | |
---|---|---|
committer | 2020-02-18 02:28:15 +0100 | |
commit | 692216042307c0ff0d792d1bba6928e499a65d1f (patch) | |
tree | a22caa4e4bbbf318bb3fc6ed2c5498f34db40536 /native/src/widget/text.rs | |
parent | 668f627532dacd5441f6990a39c327db1da40083 (diff) | |
download | iced-692216042307c0ff0d792d1bba6928e499a65d1f.tar.gz iced-692216042307c0ff0d792d1bba6928e499a65d1f.tar.bz2 iced-692216042307c0ff0d792d1bba6928e499a65d1f.zip |
Pull `Checkbox` default constants from its `Renderer`
Diffstat (limited to '')
-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 e4490fb6..7d8cad6e 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, @@ -179,10 +179,10 @@ where /// [renderer]: ../../renderer/index.html /// [`UserInterface`]: ../../struct.UserInterface.html pub trait Renderer: crate::Renderer { - /// Returns the default size of the [`Text`]. + /// The default size of [`Text`]. /// /// [`Text`]: struct.Text.html - fn default_size(&self) -> u16; + const DEFAULT_SIZE: u16; /// Measures the [`Text`] in the given bounds and returns the minimum /// boundaries that can fit the contents. |