Repo // Differentiate the colors among post-marking tooltips.
This commit is contained in:
parent
6ff42a8dbc
commit
383a3dd658
|
@ -120,6 +120,7 @@ public enum TooltipColorState {
|
|||
case denialOverflow
|
||||
case denialInsufficiency
|
||||
case prompt
|
||||
case succeeded
|
||||
}
|
||||
|
||||
// MARK: - IMEState types.
|
||||
|
|
|
@ -85,6 +85,11 @@ public class TooltipUI: NSWindowController {
|
|||
case .warning:
|
||||
backgroundColor = NSColor.purple
|
||||
textColor = NSColor.white
|
||||
case .succeeded:
|
||||
backgroundColor = NSColor(
|
||||
red: 0.21, green: 0.15, blue: 0.02, alpha: 1.00
|
||||
)
|
||||
textColor = NSColor.white
|
||||
case .denialOverflow:
|
||||
backgroundColor = NSColor(
|
||||
red: 0.13, green: 0.08, blue: 0.00, alpha: 1.00
|
||||
|
|
|
@ -141,9 +141,11 @@ extension InputHandler {
|
|||
// Enter
|
||||
if input.isEnter {
|
||||
var tooltipMessage = "+ Successful in adding / boosting a user phrase."
|
||||
var tooltipColorState: TooltipColorState = .normal
|
||||
// 先判斷是否是在摁了降權組合鍵的時候目標不在庫。
|
||||
if input.isShiftHold, input.isCommandHold {
|
||||
tooltipMessage = "- Successful in nerfing a user phrase."
|
||||
tooltipColorState = .succeeded
|
||||
if !state.isFilterable {
|
||||
delegate.callError("2EAC1F7A")
|
||||
return true
|
||||
|
@ -159,7 +161,7 @@ extension InputHandler {
|
|||
}
|
||||
var newState = generateStateOfInputting()
|
||||
newState.tooltip = NSLocalizedString(tooltipMessage, comment: "") + " "
|
||||
newState.data.tooltipColorState = .normal
|
||||
newState.data.tooltipColorState = tooltipColorState
|
||||
newState.tooltipDuration = 1.85
|
||||
delegate.switchState(newState)
|
||||
return true
|
||||
|
@ -178,7 +180,7 @@ extension InputHandler {
|
|||
}
|
||||
var newState = generateStateOfInputting()
|
||||
newState.tooltip = NSLocalizedString(tooltipMessage, comment: "") + " "
|
||||
newState.data.tooltipColorState = .normal
|
||||
newState.data.tooltipColorState = .warning
|
||||
newState.tooltipDuration = 1.85
|
||||
delegate.switchState(newState)
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue