@@ -20,7 +20,7 @@ use strings::commands;
20
20
use tui:: {
21
21
backend:: Backend ,
22
22
layout:: { Alignment , Constraint , Direction , Layout , Rect } ,
23
- style:: { Color , Style } ,
23
+ style:: { Color , Modifier , Style } ,
24
24
widgets:: { Block , Borders , Paragraph , Tabs , Text } ,
25
25
Frame ,
26
26
} ;
@@ -72,16 +72,7 @@ impl App {
72
72
)
73
73
. split ( f. size ( ) ) ;
74
74
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 ] ) ;
85
76
86
77
if self . tab == 0 {
87
78
self . status_tab . draw ( f, chunks_main[ 1 ] ) ;
@@ -312,6 +303,23 @@ impl App {
312
303
self . msg . draw ( f, size) ;
313
304
}
314
305
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
+
315
323
fn draw_commands < B : Backend > (
316
324
f : & mut Frame < B > ,
317
325
r : Rect ,
0 commit comments