aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ttyplay/display.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-04 20:19:58 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-04 20:19:58 -0500
commitde4c2b1de367aa2b6d20ec0c90f317e19d245ae9 (patch)
treeb4cd7261fdd046131aff66fbf4bf030651ae69ce /src/bin/ttyplay/display.rs
parent9aea0a1471072f9dc19c4c0e07eb98cb5bc40828 (diff)
downloadttyrec-bin-de4c2b1de367aa2b6d20ec0c90f317e19d245ae9.tar.gz
ttyrec-bin-de4c2b1de367aa2b6d20ec0c90f317e19d245ae9.zip
allow hiding the ui when paused
Diffstat (limited to 'src/bin/ttyplay/display.rs')
-rw-r--r--src/bin/ttyplay/display.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/ttyplay/display.rs b/src/bin/ttyplay/display.rs
index 486cb0b..b1836d8 100644
--- a/src/bin/ttyplay/display.rs
+++ b/src/bin/ttyplay/display.rs
@@ -5,6 +5,7 @@ pub struct Display {
total_frames: usize,
done_loading: bool,
paused: bool,
+ show_ui: bool,
}
impl Display {
@@ -14,6 +15,7 @@ impl Display {
total_frames: 0,
done_loading: false,
paused: false,
+ show_ui: true,
}
}
@@ -41,6 +43,10 @@ impl Display {
self.paused = paused;
}
+ pub fn toggle_ui(&mut self) {
+ self.show_ui = !self.show_ui;
+ }
+
pub async fn render(
&self,
screen: &vt100::Screen,
@@ -49,7 +55,7 @@ impl Display {
output.clear();
output.move_to(0, 0);
output.write(&screen.contents_formatted());
- if self.paused {
+ if self.paused && self.show_ui {
let pos = output.screen().cursor_position();
output.move_to(0, 0);