From 738aa47547818ebf57dc4f00099386a5a22a86d5 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 1 Feb 2024 01:08:21 +0100 Subject: Remove `position` from `overlay::Element` --- widget/src/pick_list.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'widget/src/pick_list.rs') diff --git a/widget/src/pick_list.rs b/widget/src/pick_list.rs index 70b1d4c0..475115c2 100644 --- a/widget/src/pick_list.rs +++ b/widget/src/pick_list.rs @@ -12,7 +12,7 @@ use crate::core::touch; use crate::core::widget::tree::{self, Tree}; use crate::core::{ Clipboard, Element, Layout, Length, Padding, Pixels, Point, Rectangle, - Shell, Size, Widget, + Shell, Size, Vector, Widget, }; use crate::overlay::menu::{self, Menu}; use crate::scrollable; @@ -265,11 +265,13 @@ where tree: &'b mut Tree, layout: Layout<'_>, renderer: &Renderer, + translation: Vector, ) -> Option> { let state = tree.state.downcast_mut::>(); overlay( layout, + translation, state, self.padding, self.text_size, @@ -573,6 +575,7 @@ pub fn mouse_interaction( /// Returns the current overlay of a [`PickList`]. pub fn overlay<'a, T, Message, Theme, Renderer>( layout: Layout<'_>, + translation: Vector, state: &'a mut State, padding: Padding, text_size: Option, @@ -617,7 +620,7 @@ where menu = menu.text_size(text_size); } - Some(menu.overlay(layout.position(), bounds.height)) + Some(menu.overlay(layout.position() + translation, bounds.height)) } else { None } -- cgit