1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//! Status bar poll intervals section (system monitor, git branch refresh rates).
use crate::SettingsUI;
use crate::section::{SLIDER_WIDTH, collapsing_section};
use std::collections::HashSet;
const SLIDER_HEIGHT: f32 = 18.0;
pub fn show_poll_intervals_section(
ui: &mut egui::Ui,
settings: &mut SettingsUI,
changes_this_frame: &mut bool,
collapsed: &mut HashSet<String>,
) {
collapsing_section(
ui,
"Poll Intervals",
"status_bar_poll_intervals",
false,
collapsed,
|ui| {
ui.horizontal(|ui| {
ui.label("System monitor:");
if ui
.add_sized(
[SLIDER_WIDTH, SLIDER_HEIGHT],
egui::Slider::new(
&mut settings.config.status_bar.status_bar_system_poll_interval,
0.5..=30.0,
)
.suffix(" sec")
.show_value(true),
)
.on_hover_text("How often to poll CPU, memory, and network usage")
.changed()
{
settings.has_changes = true;
*changes_this_frame = true;
}
});
ui.horizontal(|ui| {
ui.label("Git branch:");
if ui
.add_sized(
[SLIDER_WIDTH, SLIDER_HEIGHT],
egui::Slider::new(
&mut settings.config.status_bar.status_bar_git_poll_interval,
1.0..=60.0,
)
.suffix(" sec")
.show_value(true),
)
.on_hover_text("How often to poll the current git branch name")
.changed()
{
settings.has_changes = true;
*changes_this_frame = true;
}
});
ui.horizontal(|ui| {
ui.label("Disk free space:");
if ui
.add_sized(
[SLIDER_WIDTH, SLIDER_HEIGHT],
egui::Slider::new(
&mut settings.config.status_bar.status_bar_disk_poll_interval,
5.0..=600.0,
)
.suffix(" sec")
.show_value(true),
)
.on_hover_text("How often to poll free disk space (default 60 sec)")
.changed()
{
settings.has_changes = true;
*changes_this_frame = true;
}
});
ui.horizontal(|ui| {
if ui
.checkbox(
&mut settings.config.status_bar.status_bar_disk_follow_cwd,
"Follow active tab's directory",
)
.on_hover_text(
"Off (default): show the disk par-term launched from. \
On: show the disk containing the active tab/pane's working directory.",
)
.changed()
{
settings.has_changes = true;
*changes_this_frame = true;
}
});
},
);
}