Centre pedal knob rows
Short knob rows (one or two knobs) now sit centred in the enclosure instead of left-aligned, via symmetric spacers around each row. Shared PedalView, so it applies on macOS and iOS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -313,18 +313,17 @@ public struct PedalView: View {
|
||||
return VStack(spacing: PedalView.knobSpacing) {
|
||||
ForEach(Array(rows.enumerated()), id: \.offset) { rowPair in
|
||||
let row: [PedalKnob] = rowPair.element
|
||||
// Centre each row: a short row (one or two knobs) sits centred in the
|
||||
// enclosure rather than left-aligned. Symmetric spacers also centre a full
|
||||
// three-knob row, so every row stays horizontally centred.
|
||||
HStack(spacing: PedalView.knobSpacing) {
|
||||
Spacer(minLength: 0)
|
||||
ForEach(Array(row.enumerated()), id: \.offset) { knobPair in
|
||||
let knob: PedalKnob = knobPair.element
|
||||
ParameterKnob(knob.label, node: knob.node, range: knob.range)
|
||||
.foregroundStyle(Color.white)
|
||||
}
|
||||
// Pad short rows so knobs stay aligned in their columns.
|
||||
if row.count < PedalView.knobColumnCount {
|
||||
ForEach(0 ..< (PedalView.knobColumnCount - row.count), id: \.self) { _ in
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user