style: align translation text and reduce explanation size

This commit is contained in:
2026-10-18 11:48:39 +02:00
parent 5e504d00f9
commit cd47828ddb
3 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -142,6 +142,8 @@ final class TranslationController: NSViewController {
output.drawsBackground = false
output.textColor = SunsetPalette.text
output.font = .systemFont(ofSize: 20)
output.textContainerInset = .zero
output.textContainer?.lineFragmentPadding = 0
output.setAccessibilityLabel("\(languageName(targetLanguage)) translation")
let scroll = NSScrollView()
scroll.documentView = output
@@ -385,8 +387,10 @@ final class TranslationController: NSViewController {
.foregroundColor: SunsetPalette.text,
])
if !myMemory, let separator = translation.range(of: "\n\n") {
rendered.addAttribute(.foregroundColor, value: SunsetPalette.secondaryText,
range: NSRange(separator.upperBound..<translation.endIndex, in: translation))
rendered.addAttributes([
.foregroundColor: SunsetPalette.secondaryText,
.font: NSFont.systemFont(ofSize: 14),
], range: NSRange(separator.upperBound..<translation.endIndex, in: translation))
}
self.output.textStorage?.setAttributedString(rendered)
self.setStatus("")