Complete Scrollable::hash_layout
This commit is contained in:
parent
a3c55f7517
commit
6602c1517c
1 changed files with 14 additions and 6 deletions
|
|
@ -5,6 +5,8 @@ use crate::{
|
||||||
|
|
||||||
pub use iced_core::scrollable::State;
|
pub use iced_core::scrollable::State;
|
||||||
|
|
||||||
|
use std::hash::Hash;
|
||||||
|
|
||||||
/// A scrollable [`Column`].
|
/// A scrollable [`Column`].
|
||||||
///
|
///
|
||||||
/// [`Column`]: ../column/struct.Column.html
|
/// [`Column`]: ../column/struct.Column.html
|
||||||
|
|
@ -69,15 +71,15 @@ where
|
||||||
+ self.state.offset(bounds, content_bounds) as f32,
|
+ self.state.offset(bounds, content_bounds) as f32,
|
||||||
)
|
)
|
||||||
} else {
|
} 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)
|
Point::new(cursor_position.x, -1.0)
|
||||||
};
|
};
|
||||||
|
|
||||||
self.content.on_event(
|
self.content
|
||||||
event,
|
.on_event(event, content, cursor_position, messages)
|
||||||
layout.children().next().unwrap(),
|
|
||||||
cursor_position,
|
|
||||||
messages,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw(
|
fn draw(
|
||||||
|
|
@ -99,6 +101,12 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn hash_layout(&self, state: &mut Hasher) {
|
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)
|
self.content.hash_layout(state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue