crossmate

A collaborative crossword app for iOS
Log | Files | Refs | LICENSE

commit 1fa75ef3ad4cfa2fb33e3cf48ee074b2c0ab76de
parent 5ab0b2b441677c1e775db26de5e2786f4c317c8c
Author: Michael Camilleri <[email protected]>
Date:   Sun, 10 May 2026 22:55:50 +0900

Tweak layout of Clue List on iOS

Diffstat:
MCrossmate/Views/ClueList.swift | 36+++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/Crossmate/Views/ClueList.swift b/Crossmate/Views/ClueList.swift @@ -41,7 +41,7 @@ struct ClueList: View { currentDirection: currentDirection, currentID: currentID ) - .listStyle(.insetGrouped) + .listStyle(.plain) } else { sidebarList( current: current, @@ -58,17 +58,16 @@ struct ClueList: View { ) -> some View { ScrollViewReader { proxy in List { - Section("Across") { - ForEach(session.puzzle.acrossClues) { clue in - row(for: clue, direction: .across, current: current, currentDirection: currentDirection) - .id(rowID(direction: .across, number: clue.number)) - } + headingRow("Across") + ForEach(session.puzzle.acrossClues) { clue in + row(for: clue, direction: .across, current: current, currentDirection: currentDirection) + .id(rowID(direction: .across, number: clue.number)) } - Section("Down") { - ForEach(session.puzzle.downClues) { clue in - row(for: clue, direction: .down, current: current, currentDirection: currentDirection) - .id(rowID(direction: .down, number: clue.number)) - } + + headingRow("Down") + ForEach(session.puzzle.downClues) { clue in + row(for: clue, direction: .down, current: current, currentDirection: currentDirection) + .id(rowID(direction: .down, number: clue.number)) } } .onAppear { @@ -84,6 +83,18 @@ struct ClueList: View { } } + private func headingRow(_ title: String) -> some View { + Text(title) + .font(.footnote.weight(.semibold)) + .foregroundStyle(.secondary) + .textCase(.uppercase) + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.leading, 12) + .padding(.vertical, 6) + .listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)) + .listRowBackground(Color.clear) + } + private func sidebarList( current: Puzzle.Clue?, currentDirection: Puzzle.Direction, @@ -186,9 +197,12 @@ struct ClueList: View { .foregroundStyle(.primary) .frame(maxWidth: .infinity, alignment: .leading) } + .padding(.leading, 12) + .padding(.vertical, 10) .contentShape(Rectangle()) } .buttonStyle(.plain) + .listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)) .listRowBackground(isCurrent ? preferences.color.highlightFill : Color.clear) } }