Add overlay support in iced_pure and port PickList 🎉

This commit is contained in:
Héctor Ramón Jiménez 2022-02-16 17:07:25 +07:00
parent 35e9b75e41
commit 019af8ddbf
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
10 changed files with 731 additions and 254 deletions

View file

@ -5,6 +5,7 @@ mod checkbox;
mod column;
mod container;
mod element;
mod pick_list;
mod radio;
mod row;
mod scrollable;
@ -21,6 +22,7 @@ pub use column::Column;
pub use container::Container;
pub use element::Element;
pub use image::Image;
pub use pick_list::PickList;
pub use radio::Radio;
pub use row::Row;
pub use scrollable::Scrollable;
@ -34,6 +36,7 @@ pub use tree::Tree;
use iced_native::event::{self, Event};
use iced_native::layout::{self, Layout};
use iced_native::mouse;
use iced_native::overlay;
use iced_native::renderer;
use iced_native::{Clipboard, Hasher, Length, Point, Rectangle, Shell};
@ -97,6 +100,15 @@ pub trait Widget<Message, Renderer> {
) -> event::Status {
event::Status::Ignored
}
fn overlay<'a>(
&'a mut self,
_state: &'a mut Tree,
_layout: Layout<'_>,
_renderer: &Renderer,
) -> Option<overlay::Element<'a, Message, Renderer>> {
None
}
}
pub fn container<'a, Message, Renderer>(