@@ -1360,6 +1360,12 @@ impl UltraLogApp {
13601360 }
13611361 }
13621362
1363+ /// Stop playback and reset the frame timer
1364+ fn stop_playback ( & mut self ) {
1365+ self . is_playing = false ;
1366+ self . last_frame_time = None ;
1367+ }
1368+
13631369 // ========================================================================
13641370 // Keyboard Shortcuts
13651371 // ========================================================================
@@ -1439,8 +1445,7 @@ impl UltraLogApp {
14391445
14401446 // Arrow Left - step one record backward (Shift = 10 records)
14411447 if i. key_pressed ( egui:: Key :: ArrowLeft ) {
1442- self . is_playing = false ;
1443- self . last_frame_time = None ;
1448+ self . stop_playback ( ) ;
14441449 if let Some ( tab_idx) = self . active_tab {
14451450 let file_index = self . tabs [ tab_idx] . file_index ;
14461451 if file_index < self . files . len ( ) {
@@ -1459,8 +1464,7 @@ impl UltraLogApp {
14591464
14601465 // Arrow Right - step one record forward (Shift = 10 records)
14611466 if i. key_pressed ( egui:: Key :: ArrowRight ) {
1462- self . is_playing = false ;
1463- self . last_frame_time = None ;
1467+ self . stop_playback ( ) ;
14641468 if let Some ( tab_idx) = self . active_tab {
14651469 let file_index = self . tabs [ tab_idx] . file_index ;
14661470 if file_index < self . files . len ( ) {
@@ -1479,8 +1483,7 @@ impl UltraLogApp {
14791483
14801484 // Home - jump to start of log
14811485 if i. key_pressed ( egui:: Key :: Home ) {
1482- self . is_playing = false ;
1483- self . last_frame_time = None ;
1486+ self . stop_playback ( ) ;
14841487 if let Some ( ( min, _) ) = self . get_time_range ( ) {
14851488 self . set_cursor_time ( Some ( min) ) ;
14861489 let record = self . find_record_at_time ( min) ;
@@ -1491,8 +1494,7 @@ impl UltraLogApp {
14911494
14921495 // End - jump to end of log
14931496 if i. key_pressed ( egui:: Key :: End ) {
1494- self . is_playing = false ;
1495- self . last_frame_time = None ;
1497+ self . stop_playback ( ) ;
14961498 if let Some ( ( _, max) ) = self . get_time_range ( ) {
14971499 self . set_cursor_time ( Some ( max) ) ;
14981500 let record = self . find_record_at_time ( max) ;
0 commit comments