From 4826636c33fdfd10437605ccb07af65ddc45f497 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 28 Feb 2022 22:36:15 +0800 Subject: [PATCH] Voltaire // Differentiate highlighted colors to reflect current input mode. --- .../UI/CandidateUI/HorizontalCandidateController.swift | 10 +++++++++- .../UI/CandidateUI/VerticalCandidateController.swift | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Source/UI/CandidateUI/HorizontalCandidateController.swift b/Source/UI/CandidateUI/HorizontalCandidateController.swift index ab785d84..a079a1af 100644 --- a/Source/UI/CandidateUI/HorizontalCandidateController.swift +++ b/Source/UI/CandidateUI/HorizontalCandidateController.swift @@ -127,7 +127,15 @@ fileprivate class HorizontalCandidateView: NSView { var activeCandidateIndexAttr = keyLabelAttrDict var activeCandidateAttr = candidateAttrDict if index == highlightedIndex { - NSColor.alternateSelectedControlColor.setFill() // The background color of the highlightened candidate + // The background color of the highlightened candidate + switch ctlInputMethod.currentKeyHandler.inputMode { + case InputMode.imeModeCHS: + NSColor.systemRed.withAlphaComponent(0.75).setFill() + case InputMode.imeModeCHT: + NSColor.systemBlue.withAlphaComponent(0.75).setFill() + default: + NSColor.alternateSelectedControlColor.setFill() + } activeCandidateIndexAttr[.foregroundColor] = NSColor.selectedMenuItemTextColor.withAlphaComponent(0.84) // The index text color of the highlightened candidate activeCandidateAttr[.foregroundColor] = NSColor.selectedMenuItemTextColor // The phrase text color of the highlightened candidate } else { diff --git a/Source/UI/CandidateUI/VerticalCandidateController.swift b/Source/UI/CandidateUI/VerticalCandidateController.swift index d5228159..c918d290 100644 --- a/Source/UI/CandidateUI/VerticalCandidateController.swift +++ b/Source/UI/CandidateUI/VerticalCandidateController.swift @@ -133,7 +133,15 @@ fileprivate class VerticalCandidateView: NSView { var activeCandidateIndexAttr = keyLabelAttrDict var activeCandidateAttr = candidateAttrDict if index == highlightedIndex { - NSColor.alternateSelectedControlColor.setFill() // The background color of the highlightened candidate + // The background color of the highlightened candidate + switch ctlInputMethod.currentKeyHandler.inputMode { + case InputMode.imeModeCHS: + NSColor.systemRed.withAlphaComponent(0.75).setFill() + case InputMode.imeModeCHT: + NSColor.systemBlue.withAlphaComponent(0.75).setFill() + default: + NSColor.alternateSelectedControlColor.setFill() + } activeCandidateIndexAttr[.foregroundColor] = NSColor.selectedMenuItemTextColor.withAlphaComponent(0.84) // The index text color of the highlightened candidate activeCandidateAttr[.foregroundColor] = NSColor.selectedMenuItemTextColor // The phrase text color of the highlightened candidate } else {