summaryrefslogtreecommitdiffstats
path: root/pure/src/widget/scrollable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'pure/src/widget/scrollable.rs')
-rw-r--r--pure/src/widget/scrollable.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/pure/src/widget/scrollable.rs b/pure/src/widget/scrollable.rs
index badc9fc2..c3289f9e 100644
--- a/pure/src/widget/scrollable.rs
+++ b/pure/src/widget/scrollable.rs
@@ -1,4 +1,4 @@
-use crate::widget::Tree;
+use crate::widget::tree::{self, Tree};
use crate::{Element, Widget};
use iced_native::event::{self, Event};
@@ -10,8 +10,6 @@ use iced_native::{Clipboard, Hasher, Length, Point, Rectangle, Shell};
pub use iced_style::scrollable::StyleSheet;
-use std::any::{self, Any};
-
/// A widget that can vertically display an infinite amount of content with a
/// scrollbar.
#[allow(missing_debug_implementations)]
@@ -92,20 +90,20 @@ impl<'a, Message, Renderer> Widget<Message, Renderer>
where
Renderer: iced_native::Renderer,
{
- fn tag(&self) -> any::TypeId {
- any::TypeId::of::<scrollable::State>()
+ fn tag(&self) -> tree::Tag {
+ tree::Tag::of::<scrollable::State>()
}
- fn state(&self) -> Box<dyn Any> {
- Box::new(scrollable::State::new())
+ fn state(&self) -> tree::State {
+ tree::State::new(scrollable::State::new())
}
- fn diff(&self, tree: &mut Tree) {
- tree.diff_children(std::slice::from_ref(&self.content))
+ fn children(&self) -> Vec<Tree> {
+ vec![Tree::new(&self.content)]
}
- fn children_state(&self) -> Vec<Tree> {
- vec![Tree::new(&self.content)]
+ fn diff(&self, tree: &mut Tree) {
+ tree.diff_children(std::slice::from_ref(&self.content))
}
fn width(&self) -> Length {