From 11ab9332d14417cc423604f4fba3d5f940af84ea Mon Sep 17 00:00:00 2001 From: Scott Pruett Date: Sat, 4 Jun 2022 17:20:46 -0400 Subject: [PATCH] UI touchups --- src/main.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0d321d1..7ee39c2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -248,11 +248,13 @@ fn show_debug_frames( ui.text_edit_singleline(&mut debug_image.recognized_text); debug_image.image.show_max_size(ui, Vec2::new(300.0, 300.0)); - if ui.button("Learn OCR").clicked() { - let hashes = ocr::compute_box_hashes(&debug_image.rgb_image); - ocr_db - .learn_phrase(&hashes, &debug_image.recognized_text) - .unwrap(); + if name != "track" { + if ui.button("Learn OCR").clicked() { + let hashes = ocr::compute_box_hashes(&debug_image.rgb_image); + ocr_db + .learn_phrase(&hashes, &debug_image.recognized_text) + .unwrap(); + } } ui.separator(); } @@ -328,7 +330,6 @@ impl eframe::App for AppUi { if let Some(debug_lap) = &mut self.ui_state.debug_lap { show_debug_frames(ui, &ocr_db, &mut debug_lap.debug_regions); } - show_config_controls(ui, &mut self.ui_state, state.deref_mut()); } }); }); @@ -336,7 +337,7 @@ impl eframe::App for AppUi { self.ui_state.debug_lap = None; } - egui::SidePanel::left("frame").show(ctx, |ui| { + egui::SidePanel::left("frame").min_width(180.).show(ctx, |ui| { if let Some(frame) = &state.last_frame { ui.heading("Race data"); ui.label(format!("Lap: {}", frame.lap.unwrap_or(0)));