From 0872d078e2e3200e2aa2f5ee0005c34fff9effb7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 17 Feb 2023 15:56:19 +0100 Subject: Use `Pixels` for `size` methods --- native/src/widget/radio.rs | 4 ++-- native/src/widget/toggler.rs | 4 ++-- native/src/widget/tooltip.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'native/src') diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs index 62bc2447..4477b810 100644 --- a/native/src/widget/radio.rs +++ b/native/src/widget/radio.rs @@ -101,8 +101,8 @@ where } /// Sets the size of the [`Radio`] button. - pub fn size(mut self, size: f32) -> Self { - self.size = size; + pub fn size(mut self, size: impl Into) -> Self { + self.size = size.into().0; self } diff --git a/native/src/widget/toggler.rs b/native/src/widget/toggler.rs index eda8f85f..62bdce4a 100644 --- a/native/src/widget/toggler.rs +++ b/native/src/widget/toggler.rs @@ -85,8 +85,8 @@ where } /// Sets the size of the [`Toggler`]. - pub fn size(mut self, size: f32) -> Self { - self.size = size; + pub fn size(mut self, size: impl Into) -> Self { + self.size = size.into().0; self } diff --git a/native/src/widget/tooltip.rs b/native/src/widget/tooltip.rs index 084dc269..955586aa 100644 --- a/native/src/widget/tooltip.rs +++ b/native/src/widget/tooltip.rs @@ -9,8 +9,8 @@ use crate::widget::container; use crate::widget::overlay; use crate::widget::{Text, Tree}; use crate::{ - Clipboard, Element, Event, Layout, Length, Padding, Point, Rectangle, - Shell, Size, Vector, Widget, + Clipboard, Element, Event, Layout, Length, Padding, Pixels, Point, + Rectangle, Shell, Size, Vector, Widget, }; use std::borrow::Cow; @@ -59,7 +59,7 @@ where } /// Sets the size of the text of the [`Tooltip`]. - pub fn size(mut self, size: u16) -> Self { + pub fn size(mut self, size: impl Into) -> Self { self.tooltip = self.tooltip.size(size); self } -- cgit