@@ -13,17 +13,9 @@ use anyhow::Result;
13
13
use asyncgit:: { sync:: CommitId , AsyncNotification } ;
14
14
use crossbeam_channel:: Sender ;
15
15
use crossterm:: event:: Event ;
16
- use tui:: {
17
- backend:: Backend ,
18
- layout:: Rect ,
19
- text:: Span ,
20
- widgets:: { Block , Borders , Clear } ,
21
- Frame ,
22
- } ;
16
+ use tui:: { backend:: Backend , layout:: Rect , widgets:: Clear , Frame } ;
23
17
24
18
pub struct RevisionFilesPopup {
25
- title : String ,
26
- theme : SharedTheme ,
27
19
visible : bool ,
28
20
key_config : SharedKeyConfig ,
29
21
files : RevisionFilesComponent ,
@@ -38,14 +30,12 @@ impl RevisionFilesPopup {
38
30
key_config : SharedKeyConfig ,
39
31
) -> Self {
40
32
Self {
41
- title : String :: new ( ) ,
42
33
files : RevisionFilesComponent :: new (
43
34
queue,
44
35
sender,
45
- theme. clone ( ) ,
36
+ theme,
46
37
key_config. clone ( ) ,
47
38
) ,
48
- theme,
49
39
visible : false ,
50
40
key_config,
51
41
}
@@ -54,8 +44,6 @@ impl RevisionFilesPopup {
54
44
///
55
45
pub fn open ( & mut self , commit : CommitId ) -> Result < ( ) > {
56
46
self . files . set_commit ( commit) ?;
57
- self . title =
58
- format ! ( "Files at [{}]" , commit. get_short_string( ) ) ;
59
47
self . show ( ) ?;
60
48
61
49
Ok ( ( ) )
@@ -80,16 +68,16 @@ impl DrawableComponent for RevisionFilesPopup {
80
68
) -> Result < ( ) > {
81
69
if self . is_visible ( ) {
82
70
f. render_widget ( Clear , area) ;
83
- f. render_widget (
84
- Block :: default ( )
85
- . borders ( Borders :: TOP )
86
- . title ( Span :: styled (
87
- format ! ( " {}" , self . title) ,
88
- self . theme . title ( true ) ,
89
- ) )
90
- . border_style ( self . theme . block ( true ) ) ,
91
- area,
92
- ) ;
71
+ // f.render_widget(
72
+ // Block::default()
73
+ // .borders(Borders::TOP)
74
+ // .title(Span::styled(
75
+ // format!(" {}", self.title),
76
+ // self.theme.title(true),
77
+ // ))
78
+ // .border_style(self.theme.block(true)),
79
+ // area,
80
+ // );
93
81
94
82
self . files . draw ( f, area) ?;
95
83
}
0 commit comments