Voltaire // Differentiate highlighted colors to reflect current input mode.
This commit is contained in:
parent
a291a82501
commit
4826636c33
|
@ -127,7 +127,15 @@ fileprivate class HorizontalCandidateView: NSView {
|
||||||
var activeCandidateIndexAttr = keyLabelAttrDict
|
var activeCandidateIndexAttr = keyLabelAttrDict
|
||||||
var activeCandidateAttr = candidateAttrDict
|
var activeCandidateAttr = candidateAttrDict
|
||||||
if index == highlightedIndex {
|
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
|
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
|
activeCandidateAttr[.foregroundColor] = NSColor.selectedMenuItemTextColor // The phrase text color of the highlightened candidate
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -133,7 +133,15 @@ fileprivate class VerticalCandidateView: NSView {
|
||||||
var activeCandidateIndexAttr = keyLabelAttrDict
|
var activeCandidateIndexAttr = keyLabelAttrDict
|
||||||
var activeCandidateAttr = candidateAttrDict
|
var activeCandidateAttr = candidateAttrDict
|
||||||
if index == highlightedIndex {
|
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
|
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
|
activeCandidateAttr[.foregroundColor] = NSColor.selectedMenuItemTextColor // The phrase text color of the highlightened candidate
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue