summaryrefslogtreecommitdiffstats
path: root/native/src/overlay
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-04 12:24:13 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-17 15:40:17 +0100
commit7b8b01f560569ae18d9337a31ba94f6c1c2ba0dd (patch)
treeac9aac5eb82f175990da17813985d2f864897080 /native/src/overlay
parentf75e0202575ca6e3ebf7d817eecbf51e198506fd (diff)
downloadiced-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/overlay')
-rw-r--r--native/src/overlay/menu.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/native/src/overlay/menu.rs b/native/src/overlay/menu.rs
index 9e37380f..bd1f309e 100644
--- a/native/src/overlay/menu.rs
+++ b/native/src/overlay/menu.rs
@@ -28,7 +28,7 @@ where
options: &'a [T],
hovered_option: &'a mut Option<usize>,
last_selection: &'a mut Option<T>,
- width: u16,
+ width: f32,
padding: Padding,
text_size: Option<u16>,
font: Renderer::Font,
@@ -55,7 +55,7 @@ where
options,
hovered_option,
last_selection,
- width: 0,
+ width: 0.0,
padding: Padding::ZERO,
text_size: None,
font: Default::default(),
@@ -64,7 +64,7 @@ where
}
/// Sets the width of the [`Menu`].
- pub fn width(mut self, width: u16) -> Self {
+ pub fn width(mut self, width: f32) -> Self {
self.width = width;
self
}
@@ -142,7 +142,7 @@ where
{
state: &'a mut Tree,
container: Container<'a, Message, Renderer>,
- width: u16,
+ width: f32,
target_height: f32,
style: <Renderer::Theme as StyleSheet>::Style,
}
@@ -219,7 +219,7 @@ where
},
),
)
- .width(Length::Units(self.width));
+ .width(self.width);
let mut node = self.container.layout(renderer, &limits);