UI touchups

This commit is contained in:
Scott Pruett 2022-06-04 17:20:46 -04:00
parent 40aa5d02b9
commit 11ab9332d1
1 changed files with 8 additions and 7 deletions

View File

@ -248,12 +248,14 @@ fn show_debug_frames(
ui.text_edit_singleline(&mut debug_image.recognized_text); ui.text_edit_singleline(&mut debug_image.recognized_text);
debug_image.image.show_max_size(ui, Vec2::new(300.0, 300.0)); debug_image.image.show_max_size(ui, Vec2::new(300.0, 300.0));
if name != "track" {
if ui.button("Learn OCR").clicked() { if ui.button("Learn OCR").clicked() {
let hashes = ocr::compute_box_hashes(&debug_image.rgb_image); let hashes = ocr::compute_box_hashes(&debug_image.rgb_image);
ocr_db ocr_db
.learn_phrase(&hashes, &debug_image.recognized_text) .learn_phrase(&hashes, &debug_image.recognized_text)
.unwrap(); .unwrap();
} }
}
ui.separator(); ui.separator();
} }
} }
@ -328,7 +330,6 @@ impl eframe::App for AppUi {
if let Some(debug_lap) = &mut self.ui_state.debug_lap { if let Some(debug_lap) = &mut self.ui_state.debug_lap {
show_debug_frames(ui, &ocr_db, &mut debug_lap.debug_regions); 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; 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 { if let Some(frame) = &state.last_frame {
ui.heading("Race data"); ui.heading("Race data");
ui.label(format!("Lap: {}", frame.lap.unwrap_or(0))); ui.label(format!("Lap: {}", frame.lap.unwrap_or(0)));