TDKCandidates // Print character descriptions to console, etc. (#250)

* TDKCandidates // Remove certain useless default values.

* TDKCandidates // Print character descriptions to console.
This commit is contained in:
ShikiSuen 2022-11-09 20:00:07 +08:00
parent 3c88b810bc
commit 7aaa950d45
6 changed files with 13 additions and 4 deletions

View File

@ -132,6 +132,14 @@ public class CandidateCellData: Hashable {
let attrStrCandidate = NSMutableAttributedString(string: displayedText, attributes: attrCandidate) let attrStrCandidate = NSMutableAttributedString(string: displayedText, attributes: attrCandidate)
return attrStrCandidate return attrStrCandidate
} }
public var charDescriptions: String {
var result = displayedText
if displayedText.contains("("), displayedText.count > 2 {
result = displayedText.replacingOccurrences(of: "(", with: "").replacingOccurrences(of: ")", with: "")
}
return result.charDescriptions.joined(separator: "\n")
}
} }
// MARK: - Contents specifically made for macOS 12 and newer. // MARK: - Contents specifically made for macOS 12 and newer.

View File

@ -188,6 +188,7 @@ public class CandidatePool {
case .vertical: highlightVertical(at: indexSpecified) case .vertical: highlightVertical(at: indexSpecified)
@unknown default: break @unknown default: break
} }
vCLog("\n" + candidateDataAll[highlightedIndex].charDescriptions)
} }
} }

View File

@ -39,7 +39,7 @@ public struct VwrCandidateHorizontal: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme
@State public var thePool: CandidatePool @State public var thePool: CandidatePool
@State public var tooltip: String = "" @State public var tooltip: String = ""
@State public var reverseLookupResult: [String] = ["MLGB"] @State public var reverseLookupResult: [String] = []
private var positionLabel: String { private var positionLabel: String {
(thePool.highlightedIndex + 1).description + "/" + thePool.candidateDataAll.count.description (thePool.highlightedIndex + 1).description + "/" + thePool.candidateDataAll.count.description

View File

@ -38,7 +38,7 @@ public struct VwrCandidateVertical: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme
@State public var thePool: CandidatePool @State public var thePool: CandidatePool
@State public var tooltip: String = "" @State public var tooltip: String = ""
@State public var reverseLookupResult: [String] = ["MLGB"] @State public var reverseLookupResult: [String] = []
private var positionLabel: String { private var positionLabel: String {
(thePool.highlightedIndex + 1).description + "/" + thePool.candidateDataAll.count.description (thePool.highlightedIndex + 1).description + "/" + thePool.candidateDataAll.count.description

View File

@ -40,7 +40,7 @@ public struct VwrCandidateHorizontalBackports: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme
@State public var thePool: CandidatePool @State public var thePool: CandidatePool
@State public var tooltip: String = "" @State public var tooltip: String = ""
@State public var reverseLookupResult: [String] = ["MLGB"] @State public var reverseLookupResult: [String] = []
private var positionLabel: String { private var positionLabel: String {
(thePool.highlightedIndex + 1).description + "/" + thePool.candidateDataAll.count.description (thePool.highlightedIndex + 1).description + "/" + thePool.candidateDataAll.count.description

View File

@ -39,7 +39,7 @@ public struct VwrCandidateVerticalBackports: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme
@State public var thePool: CandidatePool @State public var thePool: CandidatePool
@State public var tooltip: String = "" @State public var tooltip: String = ""
@State public var reverseLookupResult: [String] = ["MLGB"] @State public var reverseLookupResult: [String] = []
private var positionLabel: String { private var positionLabel: String {
(thePool.highlightedIndex + 1).description + "/" + thePool.candidateDataAll.count.description (thePool.highlightedIndex + 1).description + "/" + thePool.candidateDataAll.count.description