From afd9274de26ccf65285df02007b4ddb697bea9a3 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 18 Apr 2020 14:42:48 +0200 Subject: Draft `ComboBox` and `Menu` layer --- native/src/user_interface.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'native/src/user_interface.rs') diff --git a/native/src/user_interface.rs b/native/src/user_interface.rs index 6758bce3..12cea684 100644 --- a/native/src/user_interface.rs +++ b/native/src/user_interface.rs @@ -217,6 +217,14 @@ where for event in events { if let Some(overlay) = &mut self.overlay { + let base_cursor = + if overlay.layout.bounds().contains(cursor_position) { + // TODO: Encode cursor availability + Point::new(-1.0, -1.0) + } else { + cursor_position + }; + overlay.root.on_event( event.clone(), Layout::new(&overlay.layout), @@ -226,14 +234,6 @@ where clipboard, ); - let base_cursor = - if overlay.layout.bounds().contains(cursor_position) { - // TODO: Encode cursor availability - Point::new(-1.0, -1.0) - } else { - cursor_position - }; - self.base.root.widget.on_event( event, Layout::new(&self.base.layout), -- cgit