summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-29 03:29:29 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-29 03:29:29 +0100
commit6602c1517cbffbc9ff0b6052ce7288cd51eb1e67 (patch)
treea8d691bfe84b83ac76e25e9007a5f6c705aed626 /native
parenta3c55f75174f9bc87f80d7fe6236a71138d2fd77 (diff)
downloadiced-6602c1517cbffbc9ff0b6052ce7288cd51eb1e67.tar.gz
iced-6602c1517cbffbc9ff0b6052ce7288cd51eb1e67.tar.bz2
iced-6602c1517cbffbc9ff0b6052ce7288cd51eb1e67.zip
Complete `Scrollable::hash_layout`
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/scrollable.rs20
1 files changed, 14 insertions, 6 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index f9d75863..9acba3c2 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -5,6 +5,8 @@ use crate::{
pub use iced_core::scrollable::State;
+use std::hash::Hash;
+
/// A scrollable [`Column`].
///
/// [`Column`]: ../column/struct.Column.html
@@ -69,15 +71,15 @@ where
+ self.state.offset(bounds, content_bounds) as f32,
)
} else {
+ // TODO: Make `cursor_position` an `Option<Point>` so we can encode
+ // cursor unavailability.
+ // This will probably happen naturally once we add multi-window
+ // support.
Point::new(cursor_position.x, -1.0)
};
- self.content.on_event(
- event,
- layout.children().next().unwrap(),
- cursor_position,
- messages,
- )
+ self.content
+ .on_event(event, content, cursor_position, messages)
}
fn draw(
@@ -99,6 +101,12 @@ where
}
fn hash_layout(&self, state: &mut Hasher) {
+ std::any::TypeId::of::<Scrollable<'static, (), ()>>().hash(state);
+
+ self.height.hash(state);
+ self.max_height.hash(state);
+ self.align_self.hash(state);
+
self.content.hash_layout(state)
}
}