summaryrefslogtreecommitdiffstats
path: root/native/src/widget/row.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/row.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/row.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs
index 108e98e4..286c1c2d 100644
--- a/native/src/widget/row.rs
+++ b/native/src/widget/row.rs
@@ -6,14 +6,14 @@ use crate::overlay;
use crate::renderer;
use crate::widget::{Operation, Tree};
use crate::{
- Alignment, Clipboard, Element, Length, Padding, Point, Rectangle, Shell,
- Widget,
+ Alignment, Clipboard, Element, Length, Padding, Pixels, Point, Rectangle,
+ Shell, Widget,
};
/// A container that distributes its contents horizontally.
#[allow(missing_debug_implementations)]
pub struct Row<'a, Message, Renderer> {
- spacing: u16,
+ spacing: f32,
padding: Padding,
width: Length,
height: Length,
@@ -32,7 +32,7 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> {
children: Vec<Element<'a, Message, Renderer>>,
) -> Self {
Row {
- spacing: 0,
+ spacing: 0.0,
padding: Padding::ZERO,
width: Length::Shrink,
height: Length::Shrink,
@@ -46,8 +46,8 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> {
/// Custom margins per element do not exist in iced. You should use this
/// method instead! While less flexible, it helps you keep spacing between
/// elements consistent.
- pub fn spacing(mut self, units: u16) -> Self {
- self.spacing = units;
+ pub fn spacing(mut self, amount: impl Into<Pixels>) -> Self {
+ self.spacing = amount.into().0;
self
}
@@ -58,14 +58,14 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> {
}
/// Sets the width of the [`Row`].
- pub fn width(mut self, width: Length) -> Self {
- self.width = width;
+ pub fn width(mut self, width: impl Into<Length>) -> Self {
+ self.width = width.into();
self
}
/// Sets the height of the [`Row`].
- pub fn height(mut self, height: Length) -> Self {
- self.height = height;
+ pub fn height(mut self, height: impl Into<Length>) -> Self {
+ self.height = height.into();
self
}
@@ -124,7 +124,7 @@ where
renderer,
&limits,
self.padding,
- self.spacing as f32,
+ self.spacing,
self.align_items,
&self.children,
)