Widen gap between knobs in short pedal rows
Centred one- and two-knob rows now use a wider, touch-friendly inter-knob gap; full three-knob rows keep the tight spacing so they still fit the enclosure. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -187,6 +187,9 @@ public struct PedalView: View {
|
||||
private static let screwInset: CGFloat = 6
|
||||
private static let knobColumnCount: Int = 3
|
||||
private static let knobSpacing: CGFloat = 10
|
||||
/// Horizontal gap between knobs within a row. Wider than `knobSpacing` so centred
|
||||
/// rows keep a comfortable, touch-friendly gap between adjacent knobs.
|
||||
private static let knobRowItemSpacing: CGFloat = 24
|
||||
/// Horizontal gap between adjacent vertical faders in the slider bank.
|
||||
private static let sliderBankSpacing: CGFloat = 4
|
||||
/// Approximate per-fader footprint (matches `VerticalParameterSlider.controlWidth`),
|
||||
@@ -316,7 +319,12 @@ public struct PedalView: View {
|
||||
// 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) {
|
||||
// A full three-knob row keeps the tight spacing so it fits the enclosure;
|
||||
// shorter centred rows use a wider, touch-friendly gap.
|
||||
let rowItemSpacing: CGFloat = row.count >= PedalView.knobColumnCount
|
||||
? PedalView.knobSpacing
|
||||
: PedalView.knobRowItemSpacing
|
||||
HStack(spacing: rowItemSpacing) {
|
||||
Spacer(minLength: 0)
|
||||
ForEach(Array(row.enumerated()), id: \.offset) { knobPair in
|
||||
let knob: PedalKnob = knobPair.element
|
||||
|
||||
Reference in New Issue
Block a user