@@ -52,6 +52,13 @@ impl Default for ByteVisualization {
5252}
5353
5454impl ByteVisualization {
55+ pub fn cycle ( & mut self ) {
56+ use ByteVisualization :: * ;
57+ * self = match self {
58+ Bars => Percentage ,
59+ Percentage => Bars ,
60+ }
61+ }
5562 pub fn display ( & self , percentage : f64 , length : usize ) -> DisplayByteVisualization {
5663 DisplayByteVisualization {
5764 format : * self ,
@@ -187,11 +194,7 @@ impl TerminalApp {
187194 match key {
188195 Char ( '?' ) => self . toggle_help_pane ( ) ,
189196 Char ( '\t' ) => {
190- self . state . focussed = match ( self . state . focussed , self . state . help_pane ) {
191- ( Main , Some ( _) ) => Help ,
192- ( Help , _) => Main ,
193- _ => Main ,
194- } ;
197+ self . cycle_focus ( ) ;
195198 }
196199 Ctrl ( 'c' ) => break ,
197200 Char ( 'q' ) => match self . state . focussed {
@@ -221,6 +224,7 @@ impl TerminalApp {
221224 Char ( 'j' ) => self . change_entry_selection ( CursorDirection :: Down ) ,
222225 Ctrl ( 'd' ) => self . change_entry_selection ( CursorDirection :: PageDown ) ,
223226 Char ( 's' ) => self . state . sorting . toggle_size ( ) ,
227+ Char ( 'g' ) => self . display . byte_vis . cycle ( ) ,
224228 _ => { }
225229 } ,
226230 } ;
@@ -231,6 +235,15 @@ impl TerminalApp {
231235 } )
232236 }
233237
238+ fn cycle_focus ( & mut self ) {
239+ use FocussedPane :: * ;
240+ self . state . focussed = match ( self . state . focussed , self . state . help_pane ) {
241+ ( Main , Some ( _) ) => Help ,
242+ ( Help , _) => Main ,
243+ _ => Main ,
244+ } ;
245+ }
246+
234247 fn toggle_help_pane ( & mut self ) {
235248 use FocussedPane :: * ;
236249 self . state . focussed = match self . state . focussed {
0 commit comments