@@ -7,13 +7,7 @@ use std::{
77} ;
88
99use crossbeam_channel:: { Receiver , Sender } ;
10- use ratatui:: {
11- prelude:: * ,
12- widgets:: {
13- block:: { Position , Title } ,
14- * ,
15- } ,
16- } ;
10+ use ratatui:: { prelude:: * , widgets:: * } ;
1711use termion:: event:: * ;
1812
1913use thousands:: Separable ;
@@ -252,7 +246,7 @@ impl Component for DlgCpMvProgress {
252246 key_handled
253247 }
254248
255- fn handle_mouse ( & mut self , button : MouseButton , mouse_position : layout :: Position ) {
249+ fn handle_mouse ( & mut self , button : MouseButton , mouse_position : Position ) {
256250 if matches ! ( button, MouseButton :: Left | MouseButton :: Right ) {
257251 if self . btn_suspend_rect . contains ( mouse_position) {
258252 self . focus_position = 0 ;
@@ -355,13 +349,12 @@ impl Component for DlgCpMvProgress {
355349 // Upper section
356350
357351 let upper_block = Block :: default ( )
358- . title (
359- Title :: from ( Span :: styled (
352+ . title_top (
353+ Line :: from ( Span :: styled (
360354 tilde_layout ( & format ! ( " {} " , self . operation) , sections[ 0 ] . width as usize ) ,
361355 self . palette . dialog_title ,
362356 ) )
363- . position ( Position :: Top )
364- . alignment ( Alignment :: Center ) ,
357+ . centered ( ) ,
365358 )
366359 . borders ( Borders :: TOP | Borders :: LEFT | Borders :: RIGHT )
367360 . padding ( Padding :: horizontal ( 1 ) )
@@ -458,17 +451,16 @@ impl Component for DlgCpMvProgress {
458451 // Middle section
459452
460453 let middle_block = Block :: default ( )
461- . title (
462- Title :: from ( Span :: raw ( tilde_layout (
454+ . title_top (
455+ Line :: from ( Span :: raw ( tilde_layout (
463456 & format ! (
464457 " Total: {}/{} " ,
465458 human_readable_size( self . total_bytes) ,
466459 human_readable_size( self . total_size)
467460 ) ,
468461 sections[ 0 ] . width as usize ,
469462 ) ) )
470- . position ( Position :: Top )
471- . alignment ( Alignment :: Center ) ,
463+ . centered ( ) ,
472464 )
473465 . borders ( Borders :: TOP | Borders :: LEFT | Borders :: RIGHT )
474466 . border_set ( MIDDLE_BORDER_SET )
0 commit comments