aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-22 01:05:10 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-22 01:18:07 +0530
commit15517c4c3d8ccbddd7a7ed1d3ed7646cf2bb0fda (patch)
treedb7b812ebfe4a00b4b8454ed0e6e01623fdbb766 /WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
parentmacOS: Simplify NSColor extension (diff)
downloadwireguard-apple-15517c4c3d8ccbddd7a7ed1d3ed7646cf2bb0fda.tar.xz
wireguard-apple-15517c4c3d8ccbddd7a7ed1d3ed7646cf2bb0fda.zip
macOS: Refactor syntax highlighting
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift6
1 files changed, 2 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
index 2a9f6332..481cbaaa 100644
--- a/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
+++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
@@ -44,14 +44,12 @@ class ConfTextView: NSTextView {
}
private func updateTheme() {
- let theme: ConfTextStorage.TextColorTheme
switch effectiveAppearance.bestMatch(from: [.aqua, .darkAqua]) ?? .aqua {
case .darkAqua:
- theme = ConfTextStorage.TextColorTheme(plainText: NSColor(hex: "#FFFFFF"), sections: NSColor(hex: "#91D462"), keyType: NSColor(hex: "#FC5FA3"), key: NSColor(hex: "#FD8F3F"), url: NSColor(hex: "#53A5FB"), urlAttribute: NSColor(hex: "#75B492"), comments: NSColor(hex: "#6C7986"), number: NSColor(hex: "#9686F5"), error: NSColor(hex: "#FF4C4C"))
+ confTextStorage.updateAttributes(for: ConfTextDarkAquaColorTheme())
default:
- theme = ConfTextStorage.TextColorTheme(plainText: NSColor(hex: "#000000"), sections: NSColor(hex: "#326D74"), keyType: NSColor(hex: "#9B2393"), key: NSColor(hex: "#643820"), url: NSColor(hex: "#0E0EFF"), urlAttribute: NSColor(hex: "#815F03"), comments: NSColor(hex: "#536579"), number: NSColor(hex: "#1C00CF"), error: NSColor(hex: "#C41A16"))
+ confTextStorage.updateAttributes(for: ConfTextAquaColorTheme())
}
- confTextStorage.updateAttributes(for: theme)
}
}