From 4310bdf85f8b915d2ca4f4bd6c6bbf8fbfe73757 Mon Sep 17 00:00:00 2001 From: sor-ca Date: Fri, 21 Jul 2023 00:48:42 +0300 Subject: [PATCH] coametics --- src/app.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app.rs b/src/app.rs index e47a056..f77f160 100644 --- a/src/app.rs +++ b/src/app.rs @@ -158,20 +158,24 @@ impl eframe::App for TemplateApp { } egui::SidePanel::left("side_panel").show(ctx, |ui| { - ui.heading("What time is it now?"); + ui.heading("What time is it?"); ui.vertical(|ui| { ui.horizontal(|ui| { let size = (width / 20., height / 10.); ui.add_sized(size, egui::DragValue::new(&mut hour) .speed(0.1) - .clamp_range(0..=24)); + .clamp_range(0..=24) + .custom_formatter(|h, _| format!("{h:02}")) + ); ui.label(" : "); ui.add_sized(size, egui::DragValue::new(&mut minute) .speed(0.1) - .clamp_range(-1..=60)); - + .clamp_range(-1..=60) + .custom_formatter(|m, _| format!("{m:02}")) + ); }); + if minute == 60 { //dbg!(minute); self.change_hour = Hour::Next;