Voltaire // Differentiate highlight background colors between NSAppearances.
This commit is contained in:
parent
0631752867
commit
529eefc9d3
|
@ -118,12 +118,13 @@ fileprivate class HorizontalCandidateView: NSView {
|
||||||
var activeCandidateIndexAttr = keyLabelAttrDict
|
var activeCandidateIndexAttr = keyLabelAttrDict
|
||||||
var activeCandidateAttr = candidateAttrDict
|
var activeCandidateAttr = candidateAttrDict
|
||||||
if index == highlightedIndex {
|
if index == highlightedIndex {
|
||||||
|
let colorBlendAmount: CGFloat = IME.isDarkMode() ? 0.25 : 0
|
||||||
// The background color of the highlightened candidate
|
// The background color of the highlightened candidate
|
||||||
switch ctlInputMethod.currentKeyHandler.inputMode {
|
switch ctlInputMethod.currentKeyHandler.inputMode {
|
||||||
case InputMode.imeModeCHS:
|
case InputMode.imeModeCHS:
|
||||||
NSColor.systemRed.withAlphaComponent(0.75).setFill()
|
NSColor.systemRed.blended(withFraction: colorBlendAmount, of: NSColor.controlBackgroundColor)!.setFill()
|
||||||
case InputMode.imeModeCHT:
|
case InputMode.imeModeCHT:
|
||||||
NSColor.systemBlue.withAlphaComponent(0.75).setFill()
|
NSColor.systemBlue.blended(withFraction: colorBlendAmount, of: NSColor.controlBackgroundColor)!.setFill()
|
||||||
default:
|
default:
|
||||||
NSColor.alternateSelectedControlColor.setFill()
|
NSColor.alternateSelectedControlColor.setFill()
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,12 +124,13 @@ fileprivate class VerticalCandidateView: NSView {
|
||||||
var activeCandidateIndexAttr = keyLabelAttrDict
|
var activeCandidateIndexAttr = keyLabelAttrDict
|
||||||
var activeCandidateAttr = candidateAttrDict
|
var activeCandidateAttr = candidateAttrDict
|
||||||
if index == highlightedIndex {
|
if index == highlightedIndex {
|
||||||
|
let colorBlendAmount: CGFloat = IME.isDarkMode() ? 0.25 : 0
|
||||||
// The background color of the highlightened candidate
|
// The background color of the highlightened candidate
|
||||||
switch ctlInputMethod.currentKeyHandler.inputMode {
|
switch ctlInputMethod.currentKeyHandler.inputMode {
|
||||||
case InputMode.imeModeCHS:
|
case InputMode.imeModeCHS:
|
||||||
NSColor.systemRed.withAlphaComponent(0.75).setFill()
|
NSColor.systemRed.blended(withFraction: colorBlendAmount, of: NSColor.controlBackgroundColor)!.setFill()
|
||||||
case InputMode.imeModeCHT:
|
case InputMode.imeModeCHT:
|
||||||
NSColor.systemBlue.withAlphaComponent(0.75).setFill()
|
NSColor.systemBlue.blended(withFraction: colorBlendAmount, of: NSColor.controlBackgroundColor)!.setFill()
|
||||||
default:
|
default:
|
||||||
NSColor.alternateSelectedControlColor.setFill()
|
NSColor.alternateSelectedControlColor.setFill()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue