Bumped tui-realm to 0.2.1

This commit is contained in:
veeso
2021-05-02 12:09:32 +02:00
parent 4bd18c1386
commit e90f561584
14 changed files with 87 additions and 83 deletions

View File

@@ -34,7 +34,7 @@ use tuirealm::tui::{
style::{Color, Style},
widgets::{BorderType, Borders, List, ListItem, ListState},
};
use tuirealm::{Canvas, Component, Msg, Payload};
use tuirealm::{Canvas, Component, Msg, Payload, Value};
// -- props
@@ -281,7 +281,7 @@ impl Component for LogBox {
}
fn get_state(&self) -> Payload {
Payload::Unsigned(self.states.get_list_index())
Payload::One(Value::Usize(self.states.get_list_index()))
}
fn blur(&mut self) {
@@ -366,7 +366,7 @@ mod tests {
assert_eq!(component.states.list_index, 0); // Last item
assert_eq!(component.states.list_len, 3);
// get value
assert_eq!(component.get_state(), Payload::Unsigned(0));
assert_eq!(component.get_state(), Payload::One(Value::Usize(0)));
// RenderData
assert_eq!(component.states.list_index, 0);
// Set cursor to 0