@@ -20,7 +20,7 @@ use strings::commands;
2020use tui:: {
2121 backend:: Backend ,
2222 layout:: { Alignment , Constraint , Direction , Layout , Rect } ,
23- style:: { Color , Style } ,
23+ style:: { Color , Modifier , Style } ,
2424 widgets:: { Block , Borders , Paragraph , Tabs , Text } ,
2525 Frame ,
2626} ;
@@ -72,16 +72,7 @@ impl App {
7272 )
7373 . split ( f. size ( ) ) ;
7474
75- f. render_widget (
76- Tabs :: default ( )
77- . block ( Block :: default ( ) . borders ( Borders :: BOTTOM ) )
78- . titles ( & [ strings:: TAB_STATUS , strings:: TAB_LOG ] )
79- . style ( Style :: default ( ) . fg ( Color :: White ) )
80- . highlight_style ( Style :: default ( ) . fg ( Color :: Yellow ) )
81- . divider ( strings:: TAB_DIVIDER )
82- . select ( self . tab ) ,
83- chunks_main[ 0 ] ,
84- ) ;
75+ self . draw_tabs ( f, chunks_main[ 0 ] ) ;
8576
8677 if self . tab == 0 {
8778 self . status_tab . draw ( f, chunks_main[ 1 ] ) ;
@@ -312,6 +303,23 @@ impl App {
312303 self . msg . draw ( f, size) ;
313304 }
314305
306+ fn draw_tabs < B : Backend > ( & self , f : & mut Frame < B > , r : Rect ) {
307+ f. render_widget (
308+ Tabs :: default ( )
309+ . block ( Block :: default ( ) . borders ( Borders :: BOTTOM ) )
310+ . titles ( & [ strings:: TAB_STATUS , strings:: TAB_LOG ] )
311+ . style ( Style :: default ( ) . fg ( Color :: White ) )
312+ . highlight_style (
313+ Style :: default ( )
314+ . fg ( Color :: Yellow )
315+ . modifier ( Modifier :: UNDERLINED ) ,
316+ )
317+ . divider ( strings:: TAB_DIVIDER )
318+ . select ( self . tab ) ,
319+ r,
320+ ) ;
321+ }
322+
315323 fn draw_commands < B : Backend > (
316324 f : & mut Frame < B > ,
317325 r : Rect ,
0 commit comments