diff options
author | 2023-02-17 11:45:34 -0800 | |
---|---|---|
committer | 2023-02-17 11:45:34 -0800 | |
commit | 744cef5608a91fe55cbbe1adb73a9a0b5e266668 (patch) | |
tree | f88ca6ae3c481e2de74178bb3f0d1f1b685e1740 /native/src/widget/helpers.rs | |
parent | 8da098330b58542cc929f4f24d02e26bd654bae4 (diff) | |
parent | 7dc1fb488ddbd12519571b51d75ae0c28875911d (diff) | |
download | iced-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 'native/src/widget/helpers.rs')
-rw-r--r-- | native/src/widget/helpers.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/native/src/widget/helpers.rs b/native/src/widget/helpers.rs index dfd949f6..d13eca75 100644 --- a/native/src/widget/helpers.rs +++ b/native/src/widget/helpers.rs @@ -1,7 +1,7 @@ //! Helper functions to create pure widgets. use crate::overlay; use crate::widget; -use crate::{Element, Length}; +use crate::{Element, Length, Pixels}; use std::borrow::Cow; use std::ops::RangeInclusive; @@ -247,21 +247,23 @@ pub fn image<Handle>(handle: impl Into<Handle>) -> widget::Image<Handle> { /// Creates a new horizontal [`Space`] with the given [`Length`]. /// /// [`Space`]: widget::Space -pub fn horizontal_space(width: Length) -> widget::Space { +pub fn horizontal_space(width: impl Into<Length>) -> widget::Space { widget::Space::with_width(width) } /// Creates a new vertical [`Space`] with the given [`Length`]. /// /// [`Space`]: widget::Space -pub fn vertical_space(height: Length) -> widget::Space { +pub fn vertical_space(height: impl Into<Length>) -> widget::Space { widget::Space::with_height(height) } /// Creates a horizontal [`Rule`] with the given height. /// /// [`Rule`]: widget::Rule -pub fn horizontal_rule<Renderer>(height: u16) -> widget::Rule<Renderer> +pub fn horizontal_rule<Renderer>( + height: impl Into<Pixels>, +) -> widget::Rule<Renderer> where Renderer: crate::Renderer, Renderer::Theme: widget::rule::StyleSheet, @@ -272,7 +274,9 @@ where /// Creates a vertical [`Rule`] with the given width. /// /// [`Rule`]: widget::Rule -pub fn vertical_rule<Renderer>(width: u16) -> widget::Rule<Renderer> +pub fn vertical_rule<Renderer>( + width: impl Into<Pixels>, +) -> widget::Rule<Renderer> where Renderer: crate::Renderer, Renderer::Theme: widget::rule::StyleSheet, |