Compare commits
2 commits
a2cd391827
...
154141a6ed
Author | SHA1 | Date | |
---|---|---|---|
154141a6ed | |||
9f277199e0 |
1 changed files with 11 additions and 5 deletions
|
@ -40,6 +40,15 @@ impl State {
|
||||||
*tick += 1;
|
*tick += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn beating_heart(&self) -> String {
|
||||||
|
if self.last_update.duration_since(self.started).as_secs() % 2 == 0 {
|
||||||
|
"💚 "
|
||||||
|
} else {
|
||||||
|
" 💚"
|
||||||
|
}
|
||||||
|
.to_string()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
|
@ -326,11 +335,8 @@ impl StatefulWidget for &State {
|
||||||
.title(
|
.title(
|
||||||
Title::from(Line::from(vec![
|
Title::from(Line::from(vec![
|
||||||
" [q]uit ".into(),
|
" [q]uit ".into(),
|
||||||
format!(
|
self.beating_heart().into(),
|
||||||
"{}s ",
|
" ".into(),
|
||||||
self.last_update.duration_since(self.started).as_secs()
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
]))
|
]))
|
||||||
.alignment(Alignment::Center)
|
.alignment(Alignment::Center)
|
||||||
.position(ratatui::widgets::block::Position::Bottom),
|
.position(ratatui::widgets::block::Position::Bottom),
|
||||||
|
|
Loading…
Reference in a new issue