Introduce Tag and State opaque types in iced_pure::widget::tree
This commit is contained in:
parent
cff891833b
commit
35e9b75e41
16 changed files with 101 additions and 197 deletions
|
|
@ -37,15 +37,7 @@ use iced_native::mouse;
|
|||
use iced_native::renderer;
|
||||
use iced_native::{Clipboard, Hasher, Length, Point, Rectangle, Shell};
|
||||
|
||||
use std::any::{self, Any};
|
||||
|
||||
pub trait Widget<Message, Renderer> {
|
||||
fn tag(&self) -> any::TypeId;
|
||||
|
||||
fn state(&self) -> Box<dyn Any>;
|
||||
|
||||
fn children_state(&self) -> Vec<Tree>;
|
||||
|
||||
fn width(&self) -> Length;
|
||||
|
||||
fn height(&self) -> Length;
|
||||
|
|
@ -68,6 +60,18 @@ pub trait Widget<Message, Renderer> {
|
|||
viewport: &Rectangle,
|
||||
);
|
||||
|
||||
fn tag(&self) -> tree::Tag {
|
||||
tree::Tag::stateless()
|
||||
}
|
||||
|
||||
fn state(&self) -> tree::State {
|
||||
tree::State::None
|
||||
}
|
||||
|
||||
fn children(&self) -> Vec<Tree> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
fn diff(&self, _tree: &mut Tree) {}
|
||||
|
||||
fn mouse_interaction(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue