summaryrefslogtreecommitdiffstats
path: root/native/src/widget/rule.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-02-17 11:45:34 -0800
committerLibravatar Bingus <shankern@protonmail.com>2023-02-17 11:45:34 -0800
commit744cef5608a91fe55cbbe1adb73a9a0b5e266668 (patch)
treef88ca6ae3c481e2de74178bb3f0d1f1b685e1740 /native/src/widget/rule.rs
parent8da098330b58542cc929f4f24d02e26bd654bae4 (diff)
parent7dc1fb488ddbd12519571b51d75ae0c28875911d (diff)
downloadiced-744cef5608a91fe55cbbe1adb73a9a0b5e266668.tar.gz
iced-744cef5608a91fe55cbbe1adb73a9a0b5e266668.tar.bz2
iced-744cef5608a91fe55cbbe1adb73a9a0b5e266668.zip
Merge remote-tracking branch 'origin/master' into feat/multi-window-support
# Conflicts: # winit/src/window.rs
Diffstat (limited to '')
-rw-r--r--native/src/widget/rule.rs12
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(),