aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorEric Kuck <eric@bluelinelabs.com>2019-01-09 11:24:26 +0200
committerRoopesh Chander <roop@roopc.net>2019-01-14 14:52:36 +0530
commit70848c04de1da349a2c246097a462e70fe8ebadf (patch)
treee9276d16ce2fcc679dd8ec77b2e269bf6aac896b /WireGuard
parentmacOS: Support for on-demand activation (diff)
downloadwireguard-apple-70848c04de1da349a2c246097a462e70fe8ebadf.tar.xz
wireguard-apple-70848c04de1da349a2c246097a462e70fe8ebadf.zip
Syntax highlighter color updates
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift15
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift4
2 files changed, 16 insertions, 3 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
index 75c18298..223d1a5b 100644
--- a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
+++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
@@ -10,6 +10,7 @@ class ConfTextStorage: NSTextStorage {
struct TextColorTheme {
let plainText: NSColor
let sections: NSColor
+ let keyType: NSColor
let key: NSColor
let url: NSColor
let urlAttribute: NSColor
@@ -54,9 +55,21 @@ class ConfTextStorage: NSTextStorage {
.font: boldFont
],
HighlightKeytype.rawValue: [
- .foregroundColor: theme.key,
+ .foregroundColor: theme.keyType,
.font: boldFont
],
+ HighlightPublicKey.rawValue: [
+ .foregroundColor: theme.key,
+ .font: defaultFont
+ ],
+ HighlightPrivateKey.rawValue: [
+ .foregroundColor: theme.key,
+ .font: defaultFont
+ ],
+ HighlightPresharedKey.rawValue: [
+ .foregroundColor: theme.key,
+ .font: defaultFont
+ ],
HighlightIP.rawValue: [
.foregroundColor: theme.url,
.font: defaultFont
diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
index eda5ee96..4be292f6 100644
--- a/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
+++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
@@ -39,9 +39,9 @@ class ConfTextView: NSTextView {
let theme: ConfTextStorage.TextColorTheme
switch effectiveAppearance.bestMatch(from: [.aqua, .darkAqua]) ?? .aqua {
case .darkAqua:
- theme = ConfTextStorage.TextColorTheme(plainText: NSColor(hex: "#FFFFFF"), sections: NSColor(hex: "#91D462"), key: NSColor(hex: "#FC5FA3"), url: NSColor(hex: "#53A5FB"), urlAttribute: NSColor(hex: "#75B492"), comments: NSColor(hex: "#6C7986"), number: NSColor(hex: "#9686F5"), error: NSColor(hex: "#FC6A5D"))
+ 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"))
default:
- theme = ConfTextStorage.TextColorTheme(plainText: NSColor(hex: "#000000"), sections: NSColor(hex: "#326D74"), key: NSColor(hex: "#9B2393"), url: NSColor(hex: "#0E0EFF"), urlAttribute: NSColor(hex: "#815F03"), comments: NSColor(hex: "#536579"), number: NSColor(hex: "#1C00CF"), error: NSColor(hex: "#C41A16"))
+ 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: theme)
}