feat: save/restore state

This commit is contained in:
Nova
2024-02-20 23:12:23 -05:00
parent a85a9f56a6
commit c582c85a1a
10 changed files with 119 additions and 46 deletions

View File

@@ -46,6 +46,7 @@ async fn main() -> Result<()> {
}
struct AppGrid {
root: Spatial,
apps: Vec<App>,
//style: TextStyle,
}
@@ -70,7 +71,10 @@ impl AppGrid {
.ok()
})
.collect::<Vec<_>>();
AppGrid { apps }
AppGrid {
root: client.get_root().alias(),
apps,
}
}
}
impl RootHandler for AppGrid {
@@ -80,7 +84,7 @@ impl RootHandler for AppGrid {
}
}
fn save_state(&mut self) -> ClientState {
ClientState::default()
ClientState::from_root(&self.root)
}
}