Add AsyncWidgetWrapper and WidgetWrapper
This commit is contained in:
parent
ff9a16d8a3
commit
3f7ed63064
2 changed files with 73 additions and 3 deletions
|
|
@ -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>,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue