Use Pixels for size methods
This commit is contained in:
parent
67e3da5669
commit
0872d078e2
3 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue