2.6.2 SP3 // Tooltip fix. Merge PR #140 from upd/2.6.2sp3
This commit is contained in:
commit
0a1e855d9a
|
@ -8,7 +8,6 @@ $tf/
|
||||||
**/*.HTMLClient/GeneratedArtifacts
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
**/*.Server/GeneratedArtifacts
|
**/*.Server/GeneratedArtifacts
|
||||||
**/*.Server/ModelManifest.xml
|
**/*.Server/ModelManifest.xml
|
||||||
**/[Pp]ackages/*
|
|
||||||
*.app
|
*.app
|
||||||
*.appx
|
*.appx
|
||||||
*.aps
|
*.aps
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit e3277eaff3592b356f76f50362de56bdf6ed927c
|
Subproject commit 260a1dfbb383fd0e9c8affa8d1d8c08bf378a5b2
|
|
@ -86,6 +86,8 @@ public struct StateData {
|
||||||
mgrPrefs.allowedMarkLengthRange.contains(markedRange.count)
|
mgrPrefs.allowedMarkLengthRange.contains(markedRange.count)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var tooltipColorState: ctlTooltip.ColorStates = .normal
|
||||||
|
|
||||||
var attributedStringNormal: NSAttributedString {
|
var attributedStringNormal: NSAttributedString {
|
||||||
/// 考慮到因為滑鼠點擊等其它行為導致的組字區內容遞交情況,
|
/// 考慮到因為滑鼠點擊等其它行為導致的組字區內容遞交情況,
|
||||||
/// 這裡對組字區內容也加上康熙字轉換或者 JIS 漢字轉換處理。
|
/// 這裡對組字區內容也加上康熙字轉換或者 JIS 漢字轉換處理。
|
||||||
|
@ -197,7 +199,7 @@ extension StateData {
|
||||||
public static func updateParameters(_ data: inout StateData) {
|
public static func updateParameters(_ data: inout StateData) {
|
||||||
var tooltipGenerated: String {
|
var tooltipGenerated: String {
|
||||||
if mgrPrefs.phraseReplacementEnabled {
|
if mgrPrefs.phraseReplacementEnabled {
|
||||||
ctlInputMethod.tooltipInstance.setColor(state: .warning)
|
data.tooltipColorState = .warning
|
||||||
return NSLocalizedString(
|
return NSLocalizedString(
|
||||||
"⚠︎ Phrase replacement mode enabled, interfering user phrase entry.", comment: ""
|
"⚠︎ Phrase replacement mode enabled, interfering user phrase entry.", comment: ""
|
||||||
)
|
)
|
||||||
|
@ -208,14 +210,14 @@ extension StateData {
|
||||||
|
|
||||||
let text = data.displayedText.charComponents[data.markedRange].joined()
|
let text = data.displayedText.charComponents[data.markedRange].joined()
|
||||||
if data.markedRange.count < mgrPrefs.allowedMarkLengthRange.lowerBound {
|
if data.markedRange.count < mgrPrefs.allowedMarkLengthRange.lowerBound {
|
||||||
ctlInputMethod.tooltipInstance.setColor(state: .denialInsufficiency)
|
data.tooltipColorState = .denialInsufficiency
|
||||||
return String(
|
return String(
|
||||||
format: NSLocalizedString(
|
format: NSLocalizedString(
|
||||||
"\"%@\" length must ≥ 2 for a user phrase.", comment: ""
|
"\"%@\" length must ≥ 2 for a user phrase.", comment: ""
|
||||||
) + "\n◆ " + generateReadingThread(data), text
|
) + "\n◆ " + generateReadingThread(data), text
|
||||||
)
|
)
|
||||||
} else if data.markedRange.count > mgrPrefs.allowedMarkLengthRange.upperBound {
|
} else if data.markedRange.count > mgrPrefs.allowedMarkLengthRange.upperBound {
|
||||||
ctlInputMethod.tooltipInstance.setColor(state: .denialOverflow)
|
data.tooltipColorState = .denialOverflow
|
||||||
return String(
|
return String(
|
||||||
format: NSLocalizedString(
|
format: NSLocalizedString(
|
||||||
"\"%@\" length should ≤ %d for a user phrase.", comment: ""
|
"\"%@\" length should ≤ %d for a user phrase.", comment: ""
|
||||||
|
@ -229,7 +231,7 @@ extension StateData {
|
||||||
)
|
)
|
||||||
if exist {
|
if exist {
|
||||||
data.markedTargetExists = exist
|
data.markedTargetExists = exist
|
||||||
ctlInputMethod.tooltipInstance.setColor(state: .prompt)
|
data.tooltipColorState = .prompt
|
||||||
return String(
|
return String(
|
||||||
format: NSLocalizedString(
|
format: NSLocalizedString(
|
||||||
"\"%@\" already exists:\n ENTER to boost, SHIFT+COMMAND+ENTER to nerf, \n BackSpace or Delete key to exclude.",
|
"\"%@\" already exists:\n ENTER to boost, SHIFT+COMMAND+ENTER to nerf, \n BackSpace or Delete key to exclude.",
|
||||||
|
@ -237,7 +239,7 @@ extension StateData {
|
||||||
) + "\n◆ " + generateReadingThread(data), text
|
) + "\n◆ " + generateReadingThread(data), text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
ctlInputMethod.tooltipInstance.resetColor()
|
data.tooltipColorState = .normal
|
||||||
return String(
|
return String(
|
||||||
format: NSLocalizedString("\"%@\" selected. ENTER to add user phrase.", comment: "") + "\n◆ "
|
format: NSLocalizedString("\"%@\" selected. ENTER to add user phrase.", comment: "") + "\n◆ "
|
||||||
+ generateReadingThread(data),
|
+ generateReadingThread(data),
|
||||||
|
|
|
@ -58,6 +58,15 @@ extension ctlInputMethod {
|
||||||
if mgrPrefs.alwaysShowTooltipTextsHorizontally { return .horizontal }
|
if mgrPrefs.alwaysShowTooltipTextsHorizontally { return .horizontal }
|
||||||
return isVerticalTyping ? .vertical : .horizontal
|
return isVerticalTyping ? .vertical : .horizontal
|
||||||
}()
|
}()
|
||||||
|
// 強制重新初期化,因為 NSAttributedTextView 有顯示滯後性。
|
||||||
|
do {
|
||||||
|
ctlInputMethod.tooltipInstance.hide()
|
||||||
|
ctlInputMethod.tooltipInstance = .init()
|
||||||
|
if state.type == .ofMarking {
|
||||||
|
ctlInputMethod.tooltipInstance.setColor(state: state.data.tooltipColorState)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 再設定其文字顯示內容並顯示。
|
||||||
ctlInputMethod.tooltipInstance.show(
|
ctlInputMethod.tooltipInstance.show(
|
||||||
tooltip: tooltip, at: finalOrigin,
|
tooltip: tooltip, at: finalOrigin,
|
||||||
bottomOutOfScreenAdjustmentHeight: delta, direction: tooltipContentDirection
|
bottomOutOfScreenAdjustmentHeight: delta, direction: tooltipContentDirection
|
||||||
|
|
|
@ -477,7 +477,7 @@ public enum mgrPrefs {
|
||||||
@UserDefault(key: UserDef.kMaxCandidateLength.rawValue, defaultValue: 10)
|
@UserDefault(key: UserDef.kMaxCandidateLength.rawValue, defaultValue: 10)
|
||||||
static var maxCandidateLength: Int
|
static var maxCandidateLength: Int
|
||||||
|
|
||||||
static var allowedMarkLengthRange: ClosedRange<Int> = mgrPrefs.minCandidateLength...mgrPrefs.maxCandidateLength
|
static var allowedMarkLengthRange: ClosedRange<Int> { mgrPrefs.minCandidateLength...mgrPrefs.maxCandidateLength }
|
||||||
|
|
||||||
@UserDefault(key: UserDef.kShouldNotFartInLieuOfBeep.rawValue, defaultValue: true)
|
@UserDefault(key: UserDef.kShouldNotFartInLieuOfBeep.rawValue, defaultValue: true)
|
||||||
static var shouldNotFartInLieuOfBeep: Bool
|
static var shouldNotFartInLieuOfBeep: Bool
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.6.2</string>
|
<string>2.6.2</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2621</string>
|
<string>2623</string>
|
||||||
<key>UpdateInfoEndpoint</key>
|
<key>UpdateInfoEndpoint</key>
|
||||||
<string>https://gitee.com/vchewing/vChewing-macOS/raw/main/Update-Info.plist</string>
|
<string>https://gitee.com/vchewing/vChewing-macOS/raw/main/Update-Info.plist</string>
|
||||||
<key>UpdateInfoSite</key>
|
<key>UpdateInfoSite</key>
|
||||||
|
|
|
@ -1510,7 +1510,7 @@
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 2621;
|
CURRENT_PROJECT_VERSION = 2623;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
@ -1549,7 +1549,7 @@
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 2621;
|
CURRENT_PROJECT_VERSION = 2623;
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
@ -1587,7 +1587,7 @@
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 2621;
|
CURRENT_PROJECT_VERSION = 2623;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
@ -1639,7 +1639,7 @@
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 2621;
|
CURRENT_PROJECT_VERSION = 2623;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
@ -1773,7 +1773,7 @@
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 2621;
|
CURRENT_PROJECT_VERSION = 2623;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEVELOPMENT_ASSET_PATHS = "";
|
DEVELOPMENT_ASSET_PATHS = "";
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
|
@ -1832,7 +1832,7 @@
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 2621;
|
CURRENT_PROJECT_VERSION = 2623;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEVELOPMENT_ASSET_PATHS = "";
|
DEVELOPMENT_ASSET_PATHS = "";
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
|
@ -1878,7 +1878,7 @@
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 2621;
|
CURRENT_PROJECT_VERSION = 2623;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
ENABLE_HARDENED_RUNTIME = NO;
|
ENABLE_HARDENED_RUNTIME = NO;
|
||||||
|
@ -1921,7 +1921,7 @@
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 2621;
|
CURRENT_PROJECT_VERSION = 2623;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
ENABLE_HARDENED_RUNTIME = NO;
|
ENABLE_HARDENED_RUNTIME = NO;
|
||||||
|
|
Loading…
Reference in New Issue