diff options
author | 2023-02-04 12:24:13 +0100 | |
---|---|---|
committer | 2023-02-17 15:40:17 +0100 | |
commit | 7b8b01f560569ae18d9337a31ba94f6c1c2ba0dd (patch) | |
tree | ac9aac5eb82f175990da17813985d2f864897080 /native/src/widget/rule.rs | |
parent | f75e0202575ca6e3ebf7d817eecbf51e198506fd (diff) | |
download | iced-7b8b01f560569ae18d9337a31ba94f6c1c2ba0dd.tar.gz iced-7b8b01f560569ae18d9337a31ba94f6c1c2ba0dd.tar.bz2 iced-7b8b01f560569ae18d9337a31ba94f6c1c2ba0dd.zip |
Use `f32` in `Length::Units` and rename it to `Fixed`
Diffstat (limited to 'native/src/widget/rule.rs')
-rw-r--r-- | native/src/widget/rule.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/native/src/widget/rule.rs b/native/src/widget/rule.rs index 2dc7b6f0..1ab6a0d3 100644 --- a/native/src/widget/rule.rs +++ b/native/src/widget/rule.rs @@ -2,7 +2,9 @@ use crate::layout; use crate::renderer; use crate::widget::Tree; -use crate::{Color, Element, Layout, Length, Point, Rectangle, Size, Widget}; +use crate::{ + Color, Element, Layout, Length, Pixels, Point, Rectangle, Size, Widget, +}; pub use iced_style::rule::{Appearance, FillMode, StyleSheet}; @@ -25,19 +27,19 @@ where Renderer::Theme: StyleSheet, { /// Creates a horizontal [`Rule`] with the given height. - pub fn horizontal(height: u16) -> Self { + pub fn horizontal(height: impl Into<Pixels>) -> Self { Rule { width: Length::Fill, - height: Length::Units(height), + height: Length::Fixed(height.into().0), is_horizontal: true, style: Default::default(), } } /// Creates a vertical [`Rule`] with the given width. - pub fn vertical(width: u16) -> Self { + pub fn vertical(width: impl Into<Pixels>) -> Self { Rule { - width: Length::Units(width), + width: Length::Fixed(width.into().0), height: Length::Fill, is_horizontal: false, style: Default::default(), |