new rendering engine
This commit is contained in:
@@ -27,7 +27,7 @@ pub async fn run(
|
||||
let mut widget_states = Vec::new();
|
||||
for w in &widgets {
|
||||
if let Some(s) = projection.get_state(w.id).await {
|
||||
widget_states.push((w.id, s));
|
||||
widget_states.push((w.id, w.display_hint.clone(), s));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,8 +130,15 @@ async fn poll_loop(
|
||||
.await;
|
||||
|
||||
if !changed.is_empty() {
|
||||
let with_hints: Vec<_> = changed
|
||||
.iter()
|
||||
.filter_map(|(id, state)| {
|
||||
let hint = widgets.iter().find(|w| w.id == *id)?.display_hint.clone();
|
||||
Some((*id, hint, state.clone()))
|
||||
})
|
||||
.collect();
|
||||
if let Some(l) = &layout
|
||||
&& let Err(e) = broadcaster.push_screen_update(l, &changed).await
|
||||
&& let Err(e) = broadcaster.push_screen_update(l, &with_hints).await
|
||||
{
|
||||
warn!(error = %e, "failed to push update");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user