diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-04 20:19:58 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-04 20:19:58 -0500 |
commit | de4c2b1de367aa2b6d20ec0c90f317e19d245ae9 (patch) | |
tree | b4cd7261fdd046131aff66fbf4bf030651ae69ce /src/bin/ttyplay/display.rs | |
parent | 9aea0a1471072f9dc19c4c0e07eb98cb5bc40828 (diff) | |
download | ttyrec-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.rs | 8 |
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); |