File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,12 @@ impl App {
309
309
ui. spinner ( ) . on_hover_text ( "Loading" ) ;
310
310
}
311
311
312
+ if let SlideshowState :: Active { remaining } = self . slideshow {
313
+ ui. label ( format ! ( "\u{2398} {} s" , remaining. ceil_secs( ) ) ) ;
314
+ ui. ctx ( )
315
+ . request_repaint_after ( std:: time:: Duration :: from_secs ( 1 ) ) ;
316
+ }
317
+
312
318
if let Some ( to_delete) = to_delete {
313
319
self . delete_file ( ui, to_delete) ;
314
320
}
Original file line number Diff line number Diff line change @@ -99,6 +99,14 @@ impl Duration {
99
99
az:: cast :: < _ , f32 > ( self . micros ) / SECS_MICROS_F
100
100
}
101
101
102
+ pub fn whole_secs ( self ) -> u32 {
103
+ self . micros / SECS_MICROS
104
+ }
105
+
106
+ pub fn ceil_secs ( self ) -> u32 {
107
+ self . micros . div_ceil ( SECS_MICROS )
108
+ }
109
+
102
110
pub fn new_millis_f32 ( millis : f32 ) -> Result < Self , OutOfRange > {
103
111
az:: checked_cast ( millis * MILLIS_MICROS_F )
104
112
. ok_or ( OutOfRange )
You can’t perform that action at this time.
0 commit comments