From 962f0d7515e7c6cd5aa3537803f1ff3a3117d033 Mon Sep 17 00:00:00 2001 From: Musa Mahmood Date: Wed, 7 Oct 2026 22:32:42 +0100 Subject: [PATCH] [0.0.0] Viewer: an OCR button beside the search, as the OCR window only opened itself when CUDA was missing --- src/app/viewer.jai | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/viewer.jai b/src/app/viewer.jai index 9698f3f..149fb70 100644 --- a/src/app/viewer.jai +++ b/src/app/viewer.jai @@ -544,6 +544,15 @@ viewer_ui :: () { using ImGui; SameLine(); SetNextItemWidth(160); 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. if ocr_ui.scan.running {