summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-17 15:56:19 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-17 15:56:19 +0100
commit0872d078e2e3200e2aa2f5ee0005c34fff9effb7 (patch)
treee0cc12b848edbfd83054e9069fac9635d0a0f4ef /native
parent67e3da56690c0681469276f7fa8155bbfc6e585a (diff)
downloadiced-0872d078e2e3200e2aa2f5ee0005c34fff9effb7.tar.gz
iced-0872d078e2e3200e2aa2f5ee0005c34fff9effb7.tar.bz2
iced-0872d078e2e3200e2aa2f5ee0005c34fff9effb7.zip
Use `Pixels` for `size` methods
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/radio.rs4
-rw-r--r--native/src/widget/toggler.rs4
-rw-r--r--native/src/widget/tooltip.rs6
3 files changed, 7 insertions, 7 deletions
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<Pixels>) -> 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<Pixels>) -> 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<Pixels>) -> Self {
self.tooltip = self.tooltip.size(size);
self
}