InputState // Remove deprecated color definition codes.
This commit is contained in:
parent
300214be92
commit
a029460f96
|
@ -161,18 +161,13 @@ class InputState {
|
||||||
private var deleteTargetExists = false
|
private var deleteTargetExists = false
|
||||||
var tooltip: String {
|
var tooltip: String {
|
||||||
if composingBuffer.count != readings.count {
|
if composingBuffer.count != readings.count {
|
||||||
TooltipController.backgroundColor = NSColor(
|
ctlInputMethod.tooltipController.setColor(state: .redAlert)
|
||||||
red: 0.55, green: 0.00, blue: 0.00, alpha: 1.00
|
|
||||||
)
|
|
||||||
TooltipController.textColor = NSColor.white
|
|
||||||
return NSLocalizedString(
|
return NSLocalizedString(
|
||||||
"⚠︎ Unhandlable: Chars and Readings in buffer doesn't match.", comment: ""
|
"⚠︎ Unhandlable: Chars and Readings in buffer doesn't match.", comment: ""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if mgrPrefs.phraseReplacementEnabled {
|
if mgrPrefs.phraseReplacementEnabled {
|
||||||
TooltipController.backgroundColor = NSColor.purple
|
ctlInputMethod.tooltipController.setColor(state: .warning)
|
||||||
TooltipController.textColor = NSColor.white
|
|
||||||
return NSLocalizedString(
|
return NSLocalizedString(
|
||||||
"⚠︎ Phrase replacement mode enabled, interfering user phrase entry.", comment: ""
|
"⚠︎ Phrase replacement mode enabled, interfering user phrase entry.", comment: ""
|
||||||
)
|
)
|
||||||
|
@ -183,24 +178,14 @@ class InputState {
|
||||||
|
|
||||||
let text = (composingBuffer as NSString).substring(with: markedRange)
|
let text = (composingBuffer as NSString).substring(with: markedRange)
|
||||||
if markedRange.length < kMinMarkRangeLength {
|
if markedRange.length < kMinMarkRangeLength {
|
||||||
TooltipController.backgroundColor = NSColor(
|
ctlInputMethod.tooltipController.setColor(state: .denialInsufficiency)
|
||||||
red: 0.18, green: 0.18, blue: 0.18, alpha: 1.00
|
|
||||||
)
|
|
||||||
TooltipController.textColor = NSColor(
|
|
||||||
red: 0.86, green: 0.86, blue: 0.86, alpha: 1.00
|
|
||||||
)
|
|
||||||
return String(
|
return String(
|
||||||
format: NSLocalizedString(
|
format: NSLocalizedString(
|
||||||
"\"%@\" length must ≥ 2 for a user phrase.", comment: ""
|
"\"%@\" length must ≥ 2 for a user phrase.", comment: ""
|
||||||
), text
|
), text
|
||||||
)
|
)
|
||||||
} else if markedRange.length > kMaxMarkRangeLength {
|
} else if markedRange.length > kMaxMarkRangeLength {
|
||||||
TooltipController.backgroundColor = NSColor(
|
ctlInputMethod.tooltipController.setColor(state: .denialOverflow)
|
||||||
red: 0.26, green: 0.16, blue: 0.00, alpha: 1.00
|
|
||||||
)
|
|
||||||
TooltipController.textColor = NSColor(
|
|
||||||
red: 1.00, green: 0.60, blue: 0.00, alpha: 1.00
|
|
||||||
)
|
|
||||||
return String(
|
return String(
|
||||||
format: NSLocalizedString(
|
format: NSLocalizedString(
|
||||||
"\"%@\" length should ≤ %d for a user phrase.", comment: ""
|
"\"%@\" length should ≤ %d for a user phrase.", comment: ""
|
||||||
|
@ -220,22 +205,14 @@ class InputState {
|
||||||
)
|
)
|
||||||
if exist {
|
if exist {
|
||||||
deleteTargetExists = exist
|
deleteTargetExists = exist
|
||||||
TooltipController.backgroundColor = NSColor(
|
ctlInputMethod.tooltipController.setColor(state: .prompt)
|
||||||
red: 0.00, green: 0.18, blue: 0.13, alpha: 1.00
|
|
||||||
)
|
|
||||||
TooltipController.textColor = NSColor(
|
|
||||||
red: 0.00, green: 1.00, blue: 0.74, alpha: 1.00
|
|
||||||
)
|
|
||||||
return String(
|
return String(
|
||||||
format: NSLocalizedString(
|
format: NSLocalizedString(
|
||||||
"\"%@\" already exists: ENTER to boost, \n SHIFT+CMD+ENTER to exclude.", comment: ""
|
"\"%@\" already exists: ENTER to boost, \n SHIFT+CMD+ENTER to exclude.", comment: ""
|
||||||
), text
|
), text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
TooltipController.backgroundColor = NSColor(
|
ctlInputMethod.tooltipController.resetColor()
|
||||||
red: 0.18, green: 0.18, blue: 0.18, alpha: 1.00
|
|
||||||
)
|
|
||||||
TooltipController.textColor = NSColor.white
|
|
||||||
return String(
|
return String(
|
||||||
format: NSLocalizedString("\"%@\" selected. ENTER to add user phrase.", comment: ""),
|
format: NSLocalizedString("\"%@\" selected. ENTER to add user phrase.", comment: ""),
|
||||||
text
|
text
|
||||||
|
|
Loading…
Reference in New Issue