1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Basic scroll area support

Just vertical scrolling at the moment
This commit is contained in:
Emil Ernerfeldt
2020-04-21 20:52:17 +02:00
parent 4efbb94e1b
commit dbf8520e63
5 changed files with 183 additions and 10 deletions

View File

@@ -17,6 +17,11 @@ impl Default for FoldableState {
}
}
}
#[derive(Clone, Copy, Debug, Default)]
pub struct ScrollState {
/// Positive offset means scrolling down/right
pub offset: Vec2,
}
#[derive(Clone, Debug, Default)]
pub struct Memory {
@@ -25,6 +30,7 @@ pub struct Memory {
// states of various types of widgets
pub(crate) foldables: HashMap<Id, FoldableState>,
pub(crate) scroll_areas: HashMap<Id, ScrollState>,
windows: HashMap<Id, WindowState>,
/// Top is last