Add scrollable Viewport

This commit is contained in:
Cory Forsstrom 2023-04-17 13:55:40 -07:00
parent b623f280ed
commit 6ad5e03d71
No known key found for this signature in database
GPG key ID: 1DFE170A4415C9F5
4 changed files with 61 additions and 52 deletions

View file

@ -36,7 +36,7 @@ enum Message {
ScrollerWidthChanged(u16),
ScrollToBeginning,
ScrollToEnd,
Scrolled(scrollable::CurrentOffset),
Scrolled(scrollable::Viewport),
}
impl Application for ScrollableDemo {
@ -104,8 +104,8 @@ impl Application for ScrollableDemo {
self.current_scroll_offset,
)
}
Message::Scrolled(offset) => {
self.current_scroll_offset = offset.relative;
Message::Scrolled(viewport) => {
self.current_scroll_offset = viewport.relative_offset();
Command::none()
}