@@ -28,7 +28,7 @@ pub struct LogViewerApp {
28
28
show_last_filename : bool ,
29
29
track_item_align : Option < Align > ,
30
30
shortcuts : Shortcuts ,
31
- auto_scroll_to_end : bool ,
31
+ should_scroll_to_end_on_load : bool ,
32
32
// TODO 4: Add UI to set / unset field
33
33
/// When set adds a field with this name and populates it with the row numbers
34
34
pub row_idx_field_name : Option < String > ,
@@ -51,7 +51,7 @@ impl Default for LogViewerApp {
51
51
last_filename : Default :: default ( ) ,
52
52
track_item_align : Default :: default ( ) ,
53
53
shortcuts : Default :: default ( ) ,
54
- auto_scroll_to_end : Default :: default ( ) ,
54
+ should_scroll_to_end_on_load : Default :: default ( ) ,
55
55
row_idx_field_name : Some ( "row#" . to_string ( ) ) ,
56
56
should_focus_search : Default :: default ( ) ,
57
57
should_scroll : Default :: default ( ) ,
@@ -97,7 +97,7 @@ impl LogViewerApp {
97
97
let mut table_builder = TableBuilder :: new ( ui)
98
98
. striped ( true )
99
99
. resizable ( true )
100
- . stick_to_bottom ( self . auto_scroll_to_end )
100
+ // .stick_to_bottom(self.scroll_to_end_on_load) // Removed because it disabled scroll on move of selected
101
101
. cell_layout ( egui:: Layout :: left_to_right ( egui:: Align :: LEFT ) ) ;
102
102
103
103
let n = self . data_display_options . main_list_fields ( ) . len ( ) ;
@@ -308,7 +308,7 @@ impl LogViewerApp {
308
308
data. filter = old_data. filter . take ( ) ;
309
309
}
310
310
self . data = Some ( data) ;
311
- if self . auto_scroll_to_end {
311
+ if self . should_scroll_to_end_on_load {
312
312
self . move_selected_last ( ) ;
313
313
}
314
314
LoadingStatus :: NotInProgress
@@ -354,12 +354,15 @@ impl LogViewerApp {
354
354
fn ui_options ( & mut self , ui : & mut egui:: Ui ) {
355
355
ui. collapsing ( "Options" , |ui| {
356
356
ui. checkbox ( & mut self . show_last_filename , "Show last filename" ) ;
357
- ui. checkbox ( & mut self . auto_scroll_to_end , "Auto scroll to end" )
358
- . on_hover_text ( shortcut_hint_text (
359
- ui,
360
- "Enables Auto Scroll and Scroll to bottom on loading a new file" ,
361
- & self . shortcuts . auto_scroll ,
362
- ) ) ;
357
+ ui. checkbox (
358
+ & mut self . should_scroll_to_end_on_load ,
359
+ "Scroll to end on load" ,
360
+ )
361
+ . on_hover_text ( shortcut_hint_text (
362
+ ui,
363
+ "Only has an effect when a new file is loaded" ,
364
+ & self . shortcuts . auto_scroll ,
365
+ ) ) ;
363
366
ui. horizontal ( |ui| {
364
367
ui. label ( "Item align:" ) ;
365
368
self . should_scroll |= ui
@@ -459,7 +462,7 @@ impl LogViewerApp {
459
462
self . focus_search_text_edit ( ) ;
460
463
}
461
464
if ui. input_mut ( |i| i. consume_shortcut ( & self . shortcuts . auto_scroll ) ) {
462
- self . auto_scroll_to_end = !self . auto_scroll_to_end ;
465
+ self . should_scroll_to_end_on_load = !self . should_scroll_to_end_on_load ;
463
466
}
464
467
}
465
468
0 commit comments