TDKCandidates // Let maxLinesPerPage modifiable.

This commit is contained in:
ShikiSuen 2022-10-08 23:37:18 +08:00
parent 4c44cf09c9
commit ab959a5c12
1 changed files with 19 additions and 7 deletions

View File

@ -70,13 +70,25 @@ public class CandidatePool {
} }
public var maxLinesPerPage: Int { public var maxLinesPerPage: Int {
switch currentLayout { get {
case .horizontal: switch currentLayout {
return maxRowsPerPage case .horizontal:
case .vertical: return maxRowsPerPage
return maxColumnsPerPage case .vertical:
@unknown default: return maxColumnsPerPage
return 0 @unknown default:
return 0
}
}
set {
switch currentLayout {
case .horizontal:
maxRowsPerPage = newValue
case .vertical:
maxColumnsPerPage = newValue
@unknown default:
return
}
} }
} }