move uidev dashboard to dash-frontend crate

This commit is contained in:
Aleksander
2025-09-13 12:16:38 +02:00
parent 3f76dbe9cc
commit 1d8f8aca3e
75 changed files with 130 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
use crate::testbed::Testbed;
use wgui::{event::EventListenerCollection, layout::Layout};
pub struct TestbedDashboard {
frontend: dash_frontend::Frontend,
}
impl TestbedDashboard {
pub fn new(listeners: &mut EventListenerCollection<(), ()>) -> anyhow::Result<Self> {
Ok(Self {
frontend: dash_frontend::Frontend::new(dash_frontend::FrontendParams { listeners })?,
})
}
}
impl Testbed for TestbedDashboard {
fn update(&mut self, width: f32, height: f32, timestep_alpha: f32) -> anyhow::Result<()> {
self.frontend.update(width, height, timestep_alpha)?;
Ok(())
}
fn layout(&mut self) -> &mut Layout {
self.frontend.get_layout()
}
}