style: align translation text and reduce explanation size
This commit is contained in:
@@ -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("")
|
||||
|
||||
Reference in New Issue
Block a user