Add AsyncWidgetWrapper and WidgetWrapper

This commit is contained in:
Joscha 2023-04-05 23:51:02 +02:00
parent ff9a16d8a3
commit 3f7ed63064
2 changed files with 73 additions and 3 deletions

View file

@ -32,6 +32,13 @@ use self::widgets::BoxedWidget;
/// Time to spend batch processing events before redrawing the screen.
const EVENT_PROCESSING_TIME: Duration = Duration::from_millis(1000 / 15); // 15 fps
/// Error for anything that can go wrong while rendering.
#[derive(Debug, thiserror::Error)]
pub enum UiError {
#[error("{0}")]
Io(#[from] io::Error),
}
pub enum UiEvent {
GraphemeWidthsChanged,
LogChanged,
@ -51,8 +58,6 @@ enum Mode {
Log,
}
// TODO Add Error for anything that can go wrong while rendering
pub struct Ui {
event_tx: UnboundedSender<UiEvent>,