MCPcopy Create free account
hub / github.com/elastic/devfiler / time_selector

Method time_selector

src/ui/app.rs:264–284  ·  view source on GitHub ↗
(&mut self, ui: &mut Ui)

Source from the content-addressed store, hash-verified

262 }
263
264 fn time_selector(&mut self, ui: &mut Ui) {
265 ui.horizontal(|ui| {
266 for (text, duration) in [
267 ("15m", Duration::try_minutes(15).unwrap()),
268 ("1h", Duration::try_hours(1).unwrap()),
269 ("24h", Duration::try_days(1).unwrap()),
270 ] {
271 let is_active = self.auto_scroll_time == Some(duration);
272 let response = Button::selectable(is_active, text).ui(ui);
273 if response.clicked() {
274 if is_active {
275 self.auto_scroll_time = None;
276 } else {
277 self.auto_scroll_time = Some(duration);
278 }
279 }
280 }
281
282 ui.label("Last:");
283 });
284 }
285
286 fn sample_selector(&mut self, ui: &mut Ui) {
287 ui.horizontal(|ui| {

Callers 1

draw_main_windowMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected