Implement Widget::overlay for Row

This commit is contained in:
Héctor Ramón Jiménez 2020-05-07 01:33:11 +02:00
parent f655d9b967
commit a264236624

View File

@ -2,8 +2,8 @@
use std::hash::Hash; use std::hash::Hash;
use crate::{ use crate::{
layout, Align, Clipboard, Element, Event, Hasher, Layout, Length, Point, layout, Align, Clipboard, Element, Event, Hasher, Layout, Length, Overlay,
Widget, Point, Widget,
}; };
use std::u32; use std::u32;
@ -206,6 +206,17 @@ where
child.widget.hash_layout(state); child.widget.hash_layout(state);
} }
} }
fn overlay(
&mut self,
layout: Layout<'_>,
) -> Option<Overlay<'a, Message, Renderer>> {
self.children
.iter_mut()
.zip(layout.children())
.filter_map(|(child, layout)| child.widget.overlay(layout))
.next()
}
} }
/// The renderer of a [`Row`]. /// The renderer of a [`Row`].