InputHandler // Show tooltip on overriding previous intonation.

This commit is contained in:
ShikiSuen 2023-05-12 21:23:12 +08:00
parent 6963784e59
commit 1edce13f67
6 changed files with 12 additions and 0 deletions

View File

@ -31,6 +31,7 @@ extension InputHandler {
private func handlePhonabetComposition(input: InputSignalProtocol) -> Bool? { private func handlePhonabetComposition(input: InputSignalProtocol) -> Bool? {
guard let delegate = delegate else { return nil } guard let delegate = delegate else { return nil }
let existedIntonation = composer.intonation let existedIntonation = composer.intonation
var overrideHappened = false
// 調 keyConsumedByReading // 調 keyConsumedByReading
// Space // Space
@ -65,6 +66,7 @@ extension InputHandler {
walk() // Walk walk walk() // Walk walk
composer = theComposer composer = theComposer
// generateStateOfInputting()調 generateStateOfInputting() // generateStateOfInputting()調 generateStateOfInputting()
overrideHappened = true
} else { } else {
delegate.callError("4B0DD2D4語彙庫內無「\(temporaryReadingKey)」的匹配記錄,放棄覆寫游標身後的內容。") delegate.callError("4B0DD2D4語彙庫內無「\(temporaryReadingKey)」的匹配記錄,放棄覆寫游標身後的內容。")
return true return true
@ -140,6 +142,11 @@ extension InputHandler {
// setInlineDisplayWithCursor() // setInlineDisplayWithCursor()
var inputting = generateStateOfInputting() var inputting = generateStateOfInputting()
inputting.textToCommit = textToCommit inputting.textToCommit = textToCommit
if overrideHappened {
inputting.tooltip = "Previous intonation has been overridden.".localized
inputting.tooltipDuration = 2
inputting.data.tooltipColorState = .normal
}
delegate.switchState(inputting) delegate.switchState(inputting)
/// ///

View File

@ -1,4 +1,5 @@
"vChewing" = "vChewing"; "vChewing" = "vChewing";
"Previous intonation has been overridden." = "Previous intonation has been overridden.";
"It will attempt to combine with the incoming phonabet input." = "It will attempt to combine with the incoming phonabet input."; "It will attempt to combine with the incoming phonabet input." = "It will attempt to combine with the incoming phonabet input.";
"Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer."; "Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer.";
"CHS / CHT Input Mode Switch" = "CHS / CHT Input Mode Switch"; "CHS / CHT Input Mode Switch" = "CHS / CHT Input Mode Switch";

View File

@ -1,4 +1,5 @@
"vChewing" = "vChewing"; "vChewing" = "vChewing";
"Previous intonation has been overridden." = "Previous intonation has been overridden.";
"It will attempt to combine with the incoming phonabet input." = "It will attempt to combine with the incoming phonabet input."; "It will attempt to combine with the incoming phonabet input." = "It will attempt to combine with the incoming phonabet input.";
"Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer."; "Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer.";
"CHS / CHT Input Mode Switch" = "CHS / CHT Input Mode Switch"; "CHS / CHT Input Mode Switch" = "CHS / CHT Input Mode Switch";

View File

@ -1,4 +1,5 @@
"vChewing" = "威注音入力アプリ"; "vChewing" = "威注音入力アプリ";
"Previous intonation has been overridden." = "後ろ側の漢字の音調を書き直しました。";
"It will attempt to combine with the incoming phonabet input." = "この音調は次の注音入力と組み合わす。"; "It will attempt to combine with the incoming phonabet input." = "この音調は次の注音入力と組み合わす。";
"Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "音調記号。ENTER で送り出す。\nSPACE で入力緩衝列に挿入。"; "Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "音調記号。ENTER で送り出す。\nSPACE で入力緩衝列に挿入。";
"CHS / CHT Input Mode Switch" = "簡体・繁体中国語入力の切り替え"; "CHS / CHT Input Mode Switch" = "簡体・繁体中国語入力の切り替え";

View File

@ -1,4 +1,5 @@
"vChewing" = "威注音输入法"; "vChewing" = "威注音输入法";
"Previous intonation has been overridden." = "已覆写游标身后的汉字的音调。";
"It will attempt to combine with the incoming phonabet input." = "该声调亦会尝试与接下来输入的注音相组合。"; "It will attempt to combine with the incoming phonabet input." = "该声调亦会尝试与接下来输入的注音相组合。";
"Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "声调符号。敲 Enter 以递交。\n敲空格键以插入组字区。"; "Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "声调符号。敲 Enter 以递交。\n敲空格键以插入组字区。";
"CHS / CHT Input Mode Switch" = "简体/繁体中文输入模式切换"; "CHS / CHT Input Mode Switch" = "简体/繁体中文输入模式切换";

View File

@ -1,4 +1,5 @@
"vChewing" = "威注音輸入法"; "vChewing" = "威注音輸入法";
"Previous intonation has been overridden." = "已覆寫游標身後的漢字的音調。";
"It will attempt to combine with the incoming phonabet input." = "該聲調亦會嘗試與接下來輸入的注音相組合。"; "It will attempt to combine with the incoming phonabet input." = "該聲調亦會嘗試與接下來輸入的注音相組合。";
"Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "聲調符號。敲 Enter 以遞交。\n敲空格鍵以插入組字區。"; "Intonation mark. ENTER to commit.\nSPACE to insert into composition buffer." = "聲調符號。敲 Enter 以遞交。\n敲空格鍵以插入組字區。";
"CHS / CHT Input Mode Switch" = "簡體/繁體中文輸入模式切換"; "CHS / CHT Input Mode Switch" = "簡體/繁體中文輸入模式切換";