[0.1.22] Copy all text buttons in the OCR and Capture windows
This commit is contained in:
parent
7cee21122c
commit
c5ef13f146
@ -47,7 +47,7 @@ APP_NAME :: "mcap";
|
|||||||
APP_FOLDER_NAME :: "mcap";
|
APP_FOLDER_NAME :: "mcap";
|
||||||
GIT_BRANCH :: "check";
|
GIT_BRANCH :: "check";
|
||||||
GIT_HASH :: "-";
|
GIT_HASH :: "-";
|
||||||
VERSION :: "0.1.21";
|
VERSION :: "0.1.22";
|
||||||
BUILD_DATE :: "-";
|
BUILD_DATE :: "-";
|
||||||
DEBUG :: true;
|
DEBUG :: true;
|
||||||
COMPILE_TESTS :: true;
|
COMPILE_TESTS :: true;
|
||||||
|
|||||||
@ -8,7 +8,7 @@ APP_NAME :: "mcap";
|
|||||||
APP_FOLDER_NAME :: "mcap";
|
APP_FOLDER_NAME :: "mcap";
|
||||||
APP_BUNDLE_IDENTIFIER :: "com.example.mcap";
|
APP_BUNDLE_IDENTIFIER :: "com.example.mcap";
|
||||||
|
|
||||||
VERSION :: "0.1.21";
|
VERSION :: "0.1.22";
|
||||||
// Where everything goes: bin/, or bin-headless/ for builds made with no_crash_dialog, so automated
|
// Where everything goes: bin/, or bin-headless/ for builds made with no_crash_dialog, so automated
|
||||||
// builds never write over the ones you run by hand.
|
// builds never write over the ones you run by hand.
|
||||||
build_directory := "bin";
|
build_directory := "bin";
|
||||||
|
|||||||
@ -824,6 +824,8 @@ ocr_ui_frame :: () { using ImGui;
|
|||||||
if section && viewer.full_index >= 0 {
|
if section && viewer.full_index >= 0 {
|
||||||
Separator();
|
Separator();
|
||||||
Text("Text of % (% , % lines):", viewer.captures[viewer.full_index].name, section.model, section.lines.count);
|
Text("Text of % (% , % lines):", viewer.captures[viewer.full_index].name, section.model, section.lines.count);
|
||||||
|
SameLine();
|
||||||
|
if SmallButton("Copy all text") ocr_copy_all_text(section);
|
||||||
BeginChild("ocr text");
|
BeginChild("ocr text");
|
||||||
for section.lines TextUnformatted(it.text);
|
for section.lines TextUnformatted(it.text);
|
||||||
EndChild();
|
EndChild();
|
||||||
@ -850,6 +852,17 @@ text_with_links :: (text: string) { using ImGui;
|
|||||||
|
|
||||||
// ---------------------------------------------------------------- the Capture window
|
// ---------------------------------------------------------------- the Capture window
|
||||||
|
|
||||||
|
// Puts the reading on the clipboard, a line of text to each of its lines.
|
||||||
|
ocr_copy_all_text :: (section: *Mcap_Ocr_Section) {
|
||||||
|
builder: String_Builder;
|
||||||
|
builder.allocator = temp;
|
||||||
|
for section.lines {
|
||||||
|
if it_index append(*builder, "\n");
|
||||||
|
append(*builder, it.text);
|
||||||
|
}
|
||||||
|
clipboard_set_text(builder_to_string(*builder,, temp));
|
||||||
|
}
|
||||||
|
|
||||||
// The reading shown over the capture in the Capture window: the overlay's choice, else the chosen
|
// The reading shown over the capture in the Capture window: the overlay's choice, else the chosen
|
||||||
// model's, else the first there is.
|
// model's, else the first there is.
|
||||||
ocr_overlay_section :: () -> *Mcap_Ocr_Section {
|
ocr_overlay_section :: () -> *Mcap_Ocr_Section {
|
||||||
@ -911,6 +924,8 @@ ocr_ui_capture_controls :: (index: s32, path: string) { using ImGui;
|
|||||||
SameLine();
|
SameLine();
|
||||||
}
|
}
|
||||||
Checkbox("Boxes", *ocr_ui.show_boxes);
|
Checkbox("Boxes", *ocr_ui.show_boxes);
|
||||||
|
SameLine();
|
||||||
|
if SmallButton("Copy all text") ocr_copy_all_text(section);
|
||||||
if viewer.search_terms.count {
|
if viewer.search_terms.count {
|
||||||
matches := 0;
|
matches := 0;
|
||||||
for section.lines if search_line_matches(it.text, viewer.search_terms) matches += 1;
|
for section.lines if search_line_matches(it.text, viewer.search_terms) matches += 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user