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.
|
/// Sets the size of the [`Radio`] button.
|
||||||
pub fn size(mut self, size: f32) -> Self {
|
pub fn size(mut self, size: impl Into<Pixels>) -> Self {
|
||||||
self.size = size;
|
self.size = size.into().0;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the size of the [`Toggler`].
|
/// Sets the size of the [`Toggler`].
|
||||||
pub fn size(mut self, size: f32) -> Self {
|
pub fn size(mut self, size: impl Into<Pixels>) -> Self {
|
||||||
self.size = size;
|
self.size = size.into().0;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ use crate::widget::container;
|
||||||
use crate::widget::overlay;
|
use crate::widget::overlay;
|
||||||
use crate::widget::{Text, Tree};
|
use crate::widget::{Text, Tree};
|
||||||
use crate::{
|
use crate::{
|
||||||
Clipboard, Element, Event, Layout, Length, Padding, Point, Rectangle,
|
Clipboard, Element, Event, Layout, Length, Padding, Pixels, Point,
|
||||||
Shell, Size, Vector, Widget,
|
Rectangle, Shell, Size, Vector, Widget,
|
||||||
};
|
};
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
@ -59,7 +59,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the size of the text of the [`Tooltip`].
|
/// 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.tooltip = self.tooltip.size(size);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue