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
|
|
@ -9,7 +9,6 @@ use iced_native::{
|
|||
Alignment, Clipboard, Hasher, Length, Padding, Point, Rectangle, Shell,
|
||||
};
|
||||
|
||||
use std::any::{self, Any};
|
||||
use std::u32;
|
||||
|
||||
pub struct Column<'a, Message, Renderer> {
|
||||
|
|
@ -86,22 +85,14 @@ impl<'a, Message, Renderer> Widget<Message, Renderer>
|
|||
where
|
||||
Renderer: iced_native::Renderer,
|
||||
{
|
||||
fn tag(&self) -> any::TypeId {
|
||||
any::TypeId::of::<()>()
|
||||
}
|
||||
|
||||
fn state(&self) -> Box<dyn Any> {
|
||||
Box::new(())
|
||||
fn children(&self) -> Vec<Tree> {
|
||||
self.children.iter().map(Tree::new).collect()
|
||||
}
|
||||
|
||||
fn diff(&self, tree: &mut Tree) {
|
||||
tree.diff_children(&self.children);
|
||||
}
|
||||
|
||||
fn children_state(&self) -> Vec<Tree> {
|
||||
self.children.iter().map(Tree::new).collect()
|
||||
}
|
||||
|
||||
fn width(&self) -> Length {
|
||||
self.width
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue