CtlCandidateTDK // Remove the trailing divider().

This commit is contained in:
ShikiSuen 2022-10-08 20:20:26 +08:00
parent 64ab1bc676
commit 2f83ba7479
2 changed files with 16 additions and 8 deletions

View File

@ -52,7 +52,7 @@ public struct VwrCandidateVertical: View {
VStack(alignment: .leading, spacing: 0) {
ScrollView(.horizontal, showsIndicators: false) {
HStack(alignment: .top, spacing: 10) {
ForEach(thePool.rangeForCurrentPage, id: \.self) { columnIndex in
ForEach(Array(thePool.rangeForCurrentPage.enumerated()), id: \.offset) { loopIndex, columnIndex in
VStack(alignment: .leading, spacing: 0) {
ForEach(Array(thePool.candidateLines[columnIndex]), id: \.self) { currentCandidate in
HStack(spacing: 0) {
@ -69,10 +69,12 @@ public struct VwrCandidateVertical: View {
minWidth: Double(CandidateCellData.unifiedSize * 5),
alignment: .topLeading
).id(columnIndex)
if loopIndex < thePool.maxLinesPerPage - 1 {
Divider()
}
}
if thePool.maxLinesPerPage - thePool.rangeForCurrentPage.count > 0 {
ForEach(thePool.rangeForLastPageBlanked, id: \.self) { _ in
ForEach(Array(thePool.rangeForLastPageBlanked.enumerated()), id: \.offset) { loopIndex, _ in
VStack(alignment: .leading, spacing: 0) {
ForEach(0..<thePool.maxLineCapacity, id: \.self) { _ in
thePool.blankCell.attributedStringForSwiftUI.fixedSize()
@ -84,11 +86,13 @@ public struct VwrCandidateVertical: View {
maxWidth: .infinity,
alignment: .topLeading
)
if loopIndex < thePool.maxLinesPerPage - thePool.rangeForCurrentPage.count - 1 {
Divider()
}
}
}
}
}
.fixedSize(horizontal: true, vertical: false).padding(5)
.background(Color(nsColor: NSColor.controlBackgroundColor).ignoresSafeArea())
ZStack(alignment: .leading) {

View File

@ -54,7 +54,7 @@ public struct VwrCandidateVerticalBackports: View {
VStack(alignment: .leading, spacing: 0) {
ScrollView(.horizontal, showsIndicators: false) {
HStack(alignment: .top, spacing: 10) {
ForEach(thePool.rangeForCurrentPage, id: \.self) { columnIndex in
ForEach(Array(thePool.rangeForCurrentPage.enumerated()), id: \.offset) { loopIndex, columnIndex in
VStack(alignment: .leading, spacing: 0) {
ForEach(Array(thePool.candidateLines[columnIndex]), id: \.self) { currentCandidate in
HStack(spacing: 0) {
@ -71,10 +71,12 @@ public struct VwrCandidateVerticalBackports: View {
minWidth: Double(CandidateCellData.unifiedSize * 5),
alignment: .topLeading
).id(columnIndex)
if loopIndex < thePool.maxLinesPerPage - 1 {
Divider()
}
}
if thePool.maxLinesPerPage - thePool.rangeForCurrentPage.count > 0 {
ForEach(thePool.rangeForLastPageBlanked, id: \.self) { _ in
ForEach(Array(thePool.rangeForLastPageBlanked.enumerated()), id: \.offset) { loopIndex, _ in
VStack(alignment: .leading, spacing: 0) {
ForEach(0..<thePool.maxLineCapacity, id: \.self) { _ in
thePool.blankCell.attributedStringForSwiftUIBackports.fixedSize()
@ -86,11 +88,13 @@ public struct VwrCandidateVerticalBackports: View {
maxWidth: .infinity,
alignment: .topLeading
)
if loopIndex < thePool.maxLinesPerPage - thePool.rangeForCurrentPage.count - 1 {
Divider()
}
}
}
}
}
.fixedSize(horizontal: true, vertical: false).padding(5)
.background(Color(white: colorScheme == .dark ? 0.1 : 1))
ZStack(alignment: .leading) {