Implement list scroll tracking

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Max Brunsfeld 2023-11-07 10:45:38 -08:00
parent 1d34b7b9fe
commit 742180a3a8
3 changed files with 75 additions and 29 deletions

View file

@ -900,6 +900,12 @@ impl InteractiveElementState {
.as_ref()
.map(|offset| offset.lock().clone())
}
pub fn track_scroll_offset(&mut self) -> Arc<Mutex<Point<Pixels>>> {
self.scroll_offset
.get_or_insert_with(|| Arc::new(Mutex::new(Default::default())))
.clone()
}
}
impl<V> Default for StatelessInteractivity<V> {