File tree 3 files changed +23
-0
lines changed
3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -320,7 +320,21 @@ impl Component for ChangesComponent {
320
320
fn focused ( & self ) -> bool {
321
321
self . files . focused ( )
322
322
}
323
+
323
324
fn focus ( & mut self , focus : bool ) {
324
325
self . files . focus ( focus) ;
325
326
}
327
+
328
+ fn is_visible ( & self ) -> bool {
329
+ self . files . is_visible ( )
330
+ }
331
+
332
+ fn hide ( & mut self ) {
333
+ self . files . hide ( ) ;
334
+ }
335
+
336
+ fn show ( & mut self ) -> Result < ( ) > {
337
+ self . files . show ( ) ?;
338
+ Ok ( ( ) )
339
+ }
326
340
}
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ impl StatusTreeComponent {
70
70
///
71
71
pub fn update ( & mut self , list : & [ StatusItem ] ) -> Result < ( ) > {
72
72
self . pending = false ;
73
+
73
74
let new_hash = hash ( list) ;
74
75
if self . current_hash != new_hash {
75
76
self . tree . update ( list) ?;
@@ -373,6 +374,7 @@ impl DrawableComponent for StatusTreeComponent {
373
374
)
374
375
} )
375
376
. skip ( self . scroll_top . get ( ) ) ;
377
+
376
378
ui:: draw_list (
377
379
f,
378
380
r,
Original file line number Diff line number Diff line change @@ -427,6 +427,7 @@ impl Status {
427
427
}
428
428
429
429
fn check_remotes ( & mut self ) {
430
+ //TODO: make get_branches_info async
430
431
self . has_remotes =
431
432
sync:: get_branches_info ( & self . repo . borrow ( ) , false )
432
433
. map ( |branches| !branches. is_empty ( ) )
@@ -965,10 +966,16 @@ impl Component for Status {
965
966
966
967
fn hide ( & mut self ) {
967
968
self . visible = false ;
969
+
970
+ self . index . hide ( ) ;
971
+ self . index_wd . hide ( ) ;
968
972
}
969
973
970
974
fn show ( & mut self ) -> Result < ( ) > {
971
975
self . visible = true ;
976
+ self . index . show ( ) ?;
977
+ self . index_wd . show ( ) ?;
978
+
972
979
self . check_remotes ( ) ;
973
980
self . update ( ) ?;
974
981
You can’t perform that action at this time.
0 commit comments