File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -329,10 +329,7 @@ impl Screensaver {
329329 }
330330 KeyCode :: Char ( ' ' ) => self . state . pause = !self . state . pause ,
331331 KeyCode :: Char ( 'c' ) => self . clear ( ) ,
332- KeyCode :: Char ( 'l' ) => {
333- self . term_scr . clear ( ) ;
334- self . render ( ) ?
335- }
332+ KeyCode :: Char ( 'l' ) => self . redraw ( ) ?,
336333 KeyCode :: Char ( 's' ) => self . cfg . show_stats = !self . cfg . show_stats ,
337334 _ => { }
338335 } ,
@@ -343,8 +340,12 @@ impl Screensaver {
343340 InputEvent :: Resized { cols, rows } => {
344341 self . canv . resize ( ( cols, rows) ) ;
345342
343+ // self.stats_canv.resize((cols, self.stats_canv.size().1));
344+ self . stats_canv . pos . y = rows as isize - 1 ;
346345 self . stats_canv . resize ( ( cols, self . stats_canv . size ( ) . 1 ) ) ;
347346 self . term_scr . resize ( ( cols, rows) ) ;
347+
348+ self . redraw ( ) ?
348349 }
349350 _ => { }
350351 }
@@ -353,6 +354,13 @@ impl Screensaver {
353354 Ok ( ( ) )
354355 }
355356
357+ fn redraw ( & mut self ) -> Result < ( ) > {
358+ self . term_scr . clear ( ) ;
359+ self . render ( ) ?;
360+
361+ Ok ( ( ) )
362+ }
363+
356364 /// Draw a stats widget which shows pipe/piece/layers counters and the current pipe color.
357365 fn draw_stats ( & mut self ) {
358366 self . stats_canv . clear ( ) ;
You can’t perform that action at this time.
0 commit comments