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,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)));