Repo // Enable TDKCandidateBackports for macOS 10.15-11.
This commit is contained in:
parent
0685f2a390
commit
d5e01b5adf
|
@ -12,10 +12,8 @@ import Shared
|
||||||
|
|
||||||
extension PrefMgr {
|
extension PrefMgr {
|
||||||
public func fixOddPreferences() {
|
public func fixOddPreferences() {
|
||||||
// 防呆。macOS 10.11 用 IMK 選字窗會崩潰,macOS 10.13 的 IMK 選字窗仍有問題。
|
// macOS 10.15 開始才能使用 SwiftUI 構建的田所選字窗。
|
||||||
// 一般人想用的 IMK 選字窗基於 macOS 10.09 系統內建的注音輸入法的那種矩陣選字窗。
|
if #unavailable(macOS 10.15) { useIMKCandidateWindow = true }
|
||||||
// 然而,該選字窗的體驗直到 macOS 10.14 開始才在 IMKCandidates 當中正式提供。
|
|
||||||
if #unavailable(macOS 12) { useIMKCandidateWindow = true }
|
|
||||||
if #unavailable(macOS 10.15) {
|
if #unavailable(macOS 10.15) {
|
||||||
handleDefaultCandidateFontsByLangIdentifier = false
|
handleDefaultCandidateFontsByLangIdentifier = false
|
||||||
shiftKeyAccommodationBehavior = 0
|
shiftKeyAccommodationBehavior = 0
|
||||||
|
|
|
@ -12,6 +12,7 @@ import IMKUtils
|
||||||
import PopupCompositionBuffer
|
import PopupCompositionBuffer
|
||||||
import Shared
|
import Shared
|
||||||
import ShiftKeyUpChecker
|
import ShiftKeyUpChecker
|
||||||
|
import TDKCandidateBackports
|
||||||
import TooltipUI
|
import TooltipUI
|
||||||
|
|
||||||
/// 輸入法控制模組,乃在輸入法端用以控制輸入行為的基礎型別。
|
/// 輸入法控制模組,乃在輸入法端用以控制輸入行為的基礎型別。
|
||||||
|
@ -34,6 +35,9 @@ class SessionCtl: IMKInputController {
|
||||||
if #available(macOS 12, *) {
|
if #available(macOS 12, *) {
|
||||||
return PrefMgr.shared.useIMKCandidateWindow
|
return PrefMgr.shared.useIMKCandidateWindow
|
||||||
? CtlCandidateIMK(direction) : CtlCandidateTDK(direction)
|
? CtlCandidateIMK(direction) : CtlCandidateTDK(direction)
|
||||||
|
} else if #available(macOS 10.15, *) {
|
||||||
|
return PrefMgr.shared.useIMKCandidateWindow
|
||||||
|
? CtlCandidateIMK(direction) : CtlCandidateTDKBackports(direction)
|
||||||
} else {
|
} else {
|
||||||
return CtlCandidateIMK(direction)
|
return CtlCandidateIMK(direction)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
import CandidateWindow
|
import CandidateWindow
|
||||||
import NSAttributedTextView
|
import NSAttributedTextView
|
||||||
import Shared
|
import Shared
|
||||||
|
import TDKCandidateBackports
|
||||||
|
|
||||||
// MARK: - Tooltip Display and Candidate Display Methods
|
// MARK: - Tooltip Display and Candidate Display Methods
|
||||||
|
|
||||||
|
@ -107,6 +108,10 @@ extension SessionCtl {
|
||||||
Self.ctlCandidateCurrent =
|
Self.ctlCandidateCurrent =
|
||||||
PrefMgr.shared.useIMKCandidateWindow
|
PrefMgr.shared.useIMKCandidateWindow
|
||||||
? CtlCandidateIMK(candidateLayout) : CtlCandidateTDK(candidateLayout)
|
? CtlCandidateIMK(candidateLayout) : CtlCandidateTDK(candidateLayout)
|
||||||
|
} else if #available(macOS 10.15, *) {
|
||||||
|
Self.ctlCandidateCurrent =
|
||||||
|
PrefMgr.shared.useIMKCandidateWindow
|
||||||
|
? CtlCandidateIMK(candidateLayout) : CtlCandidateTDKBackports(candidateLayout)
|
||||||
} else {
|
} else {
|
||||||
Self.ctlCandidateCurrent = CtlCandidateIMK(candidateLayout)
|
Self.ctlCandidateCurrent = CtlCandidateIMK(candidateLayout)
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,6 @@ struct suiPrefPaneDevZone: View {
|
||||||
)
|
)
|
||||||
.fixedSize(horizontal: false, vertical: true)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
Divider()
|
Divider()
|
||||||
if #available(macOS 12, *) {
|
|
||||||
Toggle(
|
Toggle(
|
||||||
LocalizedStringKey("Use IMK Candidate Window instead of Tadokoro (will reboot the IME)"),
|
LocalizedStringKey("Use IMK Candidate Window instead of Tadokoro (will reboot the IME)"),
|
||||||
isOn: $selUseIMKCandidateWindow.onChange {
|
isOn: $selUseIMKCandidateWindow.onChange {
|
||||||
|
@ -65,7 +64,6 @@ struct suiPrefPaneDevZone: View {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.preferenceDescription().fixedSize(horizontal: false, vertical: true)
|
.preferenceDescription().fixedSize(horizontal: false, vertical: true)
|
||||||
}
|
|
||||||
Toggle(
|
Toggle(
|
||||||
LocalizedStringKey("Use .langIdentifier to handle UI fonts in candidate window"),
|
LocalizedStringKey("Use .langIdentifier to handle UI fonts in candidate window"),
|
||||||
isOn: $selHandleDefaultCandidateFontsByLangIdentifier.onChange {
|
isOn: $selHandleDefaultCandidateFontsByLangIdentifier.onChange {
|
||||||
|
|
Loading…
Reference in New Issue