[0.0.0] Viewer: an OCR button beside the search, as the OCR window only opened itself when CUDA was missing

This commit is contained in:
Musa Mahmood 2026-10-07 22:32:42 +01:00
parent e2334e8be5
commit 962f0d7515

View File

@ -544,6 +544,15 @@ viewer_ui :: () { using ImGui;
SameLine(); SameLine();
SetNextItemWidth(160); SetNextItemWidth(160);
SliderFloat("Size", *viewer.thumb_size, 64, MCAP_PREVIEW_MAX_SIDE, "%.0f px"); SliderFloat("Size", *viewer.thumb_size, 64, MCAP_PREVIEW_MAX_SIDE, "%.0f px");
SameLine();
// The OCR window (app/ocr_ui.jai): the model, GPU or CPU, and the library scan.
if Button("OCR") ocr_ui.window_open = !ocr_ui.window_open;
if IsItemHovered() {
engine: *Ocr_Engine;
if !ocr_ui.thread_busy engine = ocr_ui.engine; // the background thread owns it while busy
if engine SetTooltip("OCR with %, on %", engine.model.name, ifx engine.provider == .CUDA then "the GPU" else "the CPU");
else SetTooltip("OCR is starting, or could not start; the OCR window says which");
}
// A running OCR scan, as a thin bar under the search, so it shows with the OCR window closed. // A running OCR scan, as a thin bar under the search, so it shows with the OCR window closed.
if ocr_ui.scan.running { if ocr_ui.scan.running {