forked from Blendman974/faceclaw
Merge branch 'main' of https://github.com/jimrandomh/faceclaw
This commit is contained in:
commit
c162c8e633
24 files changed
+486
-154
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { GrayImage } from "../../graphics/image";
|
||||
import { getDefaultSmallFont } from "../../graphics/ui-fonts";
|
||||
import { lineStep } from "../../ui/metrics";
|
||||
import { MicLevelMeter, paintListeningHeader } from "../../ui/listening-header";
|
||||
import { MicLevelMeter, paintListeningHeader, RECORDING_FAILED_NOTICE } from "../../ui/listening-header";
|
||||
import { writeTextToDownloads } from "../../native/file-access";
|
||||
import { voiceControlBridge } from "../../native/voice-control";
|
||||
import { Layer, type LayerContext } from "../../ui/layers";
|
||||
@@ -76,9 +76,13 @@ export class TranslateLayer implements Layer {
|
||||
const image = new GrayImage(viewport.width, viewport.height, 0);
|
||||
const measure = (line: string) => font.measureText(line);
|
||||
|
||||
const status = this.problem ? "Setup needed" : this.translationError || this.status;
|
||||
const status = this.problem
|
||||
? "Setup needed"
|
||||
: voiceControlBridge.recordingFailed ? RECORDING_FAILED_NOTICE : this.translationError || this.status;
|
||||
const meter = this.listening && !this.problem ? this.meter : null;
|
||||
const bodyTop = paintListeningHeader(image, font, "Translate", this.saveNotice || status, meter, viewport.padding);
|
||||
const bodyTop = paintListeningHeader(
|
||||
image, font, "Translate", this.saveNotice || status, meter, viewport.padding, voiceControlBridge.recording,
|
||||
);
|
||||
const step = lineStep(font) + 2;
|
||||
const layout = transcriptLayout(viewport, bodyTop, font.lineHeight, step);
|
||||
const maxWidth = layout.textWidth;
|
||||
|
||||
Reference in new issue
Block a user