feat: configure launcher color scheme

This commit is contained in:
2026-10-22 15:36:44 +02:00
parent 1ec4c0d582
commit be761b4704
21 changed files with 460 additions and 150 deletions
+10 -10
View File
@@ -85,11 +85,11 @@ final class TranslationController: NSViewController {
providerButton.toolTip = "Choose translation provider (Command-P)"
providerButton.isBordered = false
providerButton.font = .systemFont(ofSize: 12, weight: .medium)
providerButton.contentTintColor = SunsetPalette.text
providerButton.contentTintColor = ThemePalette.text
let chevron = NSButton(image: NSImage(systemSymbolName: "chevron.down", accessibilityDescription: nil)!,
target: self, action: #selector(showProviders))
chevron.isBordered = false
chevron.contentTintColor = SunsetPalette.secondaryText
chevron.contentTintColor = ThemePalette.secondaryText
chevron.setAccessibilityElement(false)
stylePill(providerControl)
for control in [providerButton, chevron] {
@@ -109,7 +109,7 @@ final class TranslationController: NSViewController {
languageButton.action = #selector(showActions)
languageButton.isBordered = false
languageButton.font = .systemFont(ofSize: 12, weight: .medium)
languageButton.contentTintColor = SunsetPalette.text
languageButton.contentTintColor = ThemePalette.text
languageButton.toolTip = "Change or swap translation languages (Command-K)"
languageButton.setAccessibilityLabel("Translation languages")
actionsButton.target = self
@@ -140,7 +140,7 @@ final class TranslationController: NSViewController {
output.isEditable = false
output.isSelectable = true
output.drawsBackground = false
output.textColor = SunsetPalette.text
output.textColor = ThemePalette.text
output.font = .systemFont(ofSize: 20)
output.textContainerInset = .zero
output.textContainer?.lineFragmentPadding = 0
@@ -156,7 +156,7 @@ final class TranslationController: NSViewController {
status.setAccessibilityLabel("Translation status and errors")
status.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
sourcePreview.font = .systemFont(ofSize: 14)
sourcePreview.textColor = SunsetPalette.secondaryText
sourcePreview.textColor = ThemePalette.secondaryText
sourcePreview.maximumNumberOfLines = 3
sourcePreview.lineBreakMode = .byTruncatingTail
sourcePreview.setAccessibilityLabel("Original text to translate")
@@ -192,8 +192,8 @@ final class TranslationController: NSViewController {
pill.wantsLayer = true
pill.layer?.cornerRadius = 18
pill.layer?.borderWidth = 0.5
pill.layer?.borderColor = SunsetPalette.accent.withAlphaComponent(0.35).cgColor
pill.layer?.backgroundColor = SunsetPalette.background.withAlphaComponent(0.25).cgColor
pill.layer?.borderColor = ThemePalette.accent.withAlphaComponent(0.35).cgColor
pill.layer?.backgroundColor = ThemePalette.background.withAlphaComponent(0.25).cgColor
}
@objc func showProviders() {
@@ -308,7 +308,7 @@ final class TranslationController: NSViewController {
private func setStatus(_ message: String, isError: Bool = false) {
status.stringValue = message
status.textColor = isError ? .systemRed : SunsetPalette.secondaryText
status.textColor = isError ? ThemePalette.error : ThemePalette.secondaryText
}
@objc func performPrimaryAction() {
@@ -376,11 +376,11 @@ final class TranslationController: NSViewController {
guard !Task.isCancelled, let self else { return }
let rendered = NSMutableAttributedString(string: translation, attributes: [
.font: NSFont.systemFont(ofSize: 20),
.foregroundColor: SunsetPalette.text,
.foregroundColor: ThemePalette.text,
])
if !myMemory, let separator = translation.range(of: "\n\n") {
rendered.addAttributes([
.foregroundColor: SunsetPalette.secondaryText,
.foregroundColor: ThemePalette.secondaryText,
.font: NSFont.systemFont(ofSize: 14),
], range: NSRange(separator.upperBound..<translation.endIndex, in: translation))
}