@@ -34,7 +34,9 @@ pub struct LogViewerApp {
34
34
should_scroll_to_end_on_load : bool ,
35
35
// TODO 4: Add UI to set / unset field
36
36
/// When set adds a field with this name and populates it with the row numbers
37
- pub row_idx_field_name : Option < String > ,
37
+ row_idx_field_name : Option < String > ,
38
+ /// Allows the user to dim the warning by clicking on it
39
+ should_highlight_field_warning : bool ,
38
40
39
41
#[ serde( skip) ]
40
42
should_focus_search : bool ,
@@ -56,6 +58,7 @@ impl Default for LogViewerApp {
56
58
shortcuts : Default :: default ( ) ,
57
59
should_scroll_to_end_on_load : Default :: default ( ) ,
58
60
row_idx_field_name : Some ( "row#" . to_string ( ) ) ,
61
+ should_highlight_field_warning : true ,
59
62
should_focus_search : Default :: default ( ) ,
60
63
should_scroll : Default :: default ( ) ,
61
64
show_last_filename : true ,
@@ -587,6 +590,24 @@ impl LogViewerApp {
587
590
{
588
591
should_apply_filter = true ;
589
592
}
593
+
594
+ let color = if self . should_highlight_field_warning {
595
+ ui. visuals ( ) . warn_fg_color
596
+ } else {
597
+ ui. visuals ( ) . text_color ( )
598
+ } ;
599
+ let hint_text = if self . should_highlight_field_warning {
600
+ "Click to DIM warning"
601
+ } else {
602
+ "Click to Highlight warning"
603
+ } ;
604
+ if ui
605
+ . colored_label ( color, "(Field filtering enabled)" )
606
+ . on_hover_text ( hint_text)
607
+ . clicked ( )
608
+ {
609
+ self . should_highlight_field_warning = !self . should_highlight_field_warning ;
610
+ } ;
590
611
}
591
612
}
592
613
if should_apply_filter {
0 commit comments