diff --git a/Packages/vChewing_Shared/Sources/Shared/Shared.swift b/Packages/vChewing_Shared/Sources/Shared/Shared.swift index 650087a0..c9de3c28 100644 --- a/Packages/vChewing_Shared/Sources/Shared/Shared.swift +++ b/Packages/vChewing_Shared/Sources/Shared/Shared.swift @@ -120,6 +120,7 @@ public enum TooltipColorState { case denialOverflow case denialInsufficiency case prompt + case succeeded } // MARK: - IMEState types. diff --git a/Packages/vChewing_TooltipUI/Sources/TooltipUI/TooltipUI.swift b/Packages/vChewing_TooltipUI/Sources/TooltipUI/TooltipUI.swift index 885ea976..6654ab7f 100644 --- a/Packages/vChewing_TooltipUI/Sources/TooltipUI/TooltipUI.swift +++ b/Packages/vChewing_TooltipUI/Sources/TooltipUI/TooltipUI.swift @@ -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 diff --git a/Source/Modules/InputHandler_HandleStates.swift b/Source/Modules/InputHandler_HandleStates.swift index b2ce2d4b..a4a7f439 100644 --- a/Source/Modules/InputHandler_HandleStates.swift +++ b/Source/Modules/InputHandler_HandleStates.swift @@ -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