Compact board mixer bar; align scope/CPU to palette width
Shrink BoardBarView to a fixed-height single horizontal scroll group with a tighter two-row control column, so it wraps its elements and frees vertical canvas for the pedals. Constrain the scope and CPU-meter views to the pedal palette width, left-aligned, so they sit under the palette column. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -40,13 +40,16 @@ public struct BoardBarView: View {
|
|||||||
|
|
||||||
// MARK: - Layout constants
|
// MARK: - Layout constants
|
||||||
|
|
||||||
private static let barSpacing: CGFloat = 12
|
private static let barSpacing: CGFloat = 10
|
||||||
|
private static let barHeight: CGFloat = 92
|
||||||
private static let cellSpacing: CGFloat = 8
|
private static let cellSpacing: CGFloat = 8
|
||||||
private static let cellWidth: CGFloat = 116
|
private static let cellWidth: CGFloat = 104
|
||||||
private static let cellInnerSpacing: CGFloat = 6
|
private static let cellInnerSpacing: CGFloat = 5
|
||||||
private static let cellPadding: CGFloat = 8
|
private static let cellPadding: CGFloat = 7
|
||||||
private static let cellCornerRadius: CGFloat = 8
|
private static let cellCornerRadius: CGFloat = 8
|
||||||
private static let controlColumnWidth: CGFloat = 150
|
private static let controlColumnWidth: CGFloat = 188
|
||||||
|
private static let modePickerWidth: CGFloat = 104
|
||||||
|
private static let crossfadeSliderMinWidth: CGFloat = 64
|
||||||
private static let ledDiameter: CGFloat = 12
|
private static let ledDiameter: CGFloat = 12
|
||||||
private static let ledGlowRadius: CGFloat = 6
|
private static let ledGlowRadius: CGFloat = 6
|
||||||
private static let ledGlowOpacity: Double = 0.75
|
private static let ledGlowOpacity: Double = 0.75
|
||||||
@@ -96,50 +99,53 @@ public struct BoardBarView: View {
|
|||||||
// MARK: - Body
|
// MARK: - Body
|
||||||
|
|
||||||
public var body: some View {
|
public var body: some View {
|
||||||
|
// One horizontal scroll group so the whole bar hugs its content and stays a short,
|
||||||
|
// fixed-height band — leaving the canvas below for the pedals.
|
||||||
|
ScrollView(.horizontal, showsIndicators: false) {
|
||||||
HStack(alignment: .center, spacing: BoardBarView.barSpacing) {
|
HStack(alignment: .center, spacing: BoardBarView.barSpacing) {
|
||||||
controlColumn
|
controlColumn
|
||||||
Divider().overlay(Color.white.opacity(BoardBarView.idleBorderOpacity))
|
Divider().overlay(Color.white.opacity(BoardBarView.idleBorderOpacity))
|
||||||
ScrollView(.horizontal, showsIndicators: false) {
|
|
||||||
HStack(spacing: BoardBarView.cellSpacing) {
|
|
||||||
ForEach(Array(shoeGaze.boards.enumerated()), id: \.offset) { pair in
|
ForEach(Array(shoeGaze.boards.enumerated()), id: \.offset) { pair in
|
||||||
boardCell(index: pair.offset, board: pair.element)
|
boardCell(index: pair.offset, board: pair.element)
|
||||||
}
|
}
|
||||||
addButton
|
addButton
|
||||||
}
|
}
|
||||||
|
.frame(height: BoardBarView.barHeight)
|
||||||
}
|
}
|
||||||
}
|
.frame(height: BoardBarView.barHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Control column
|
// MARK: - Control column
|
||||||
|
|
||||||
private var controlColumn: some View {
|
private var controlColumn: some View {
|
||||||
VStack(alignment: .leading, spacing: BoardBarView.cellInnerSpacing) {
|
VStack(alignment: .leading, spacing: BoardBarView.cellInnerSpacing) {
|
||||||
|
HStack(spacing: BoardBarView.cellInnerSpacing) {
|
||||||
Picker("Mode", selection: $mode) {
|
Picker("Mode", selection: $mode) {
|
||||||
Text("Solo").tag(PlayMode.solo)
|
Text("Solo").tag(PlayMode.solo)
|
||||||
Text("Blend").tag(PlayMode.blend)
|
Text("Blend").tag(PlayMode.blend)
|
||||||
}
|
}
|
||||||
.pickerStyle(.segmented)
|
.pickerStyle(.segmented)
|
||||||
.labelsHidden()
|
.labelsHidden()
|
||||||
|
.frame(width: BoardBarView.modePickerWidth)
|
||||||
|
|
||||||
HStack(spacing: BoardBarView.cellInnerSpacing) {
|
|
||||||
Button("All") {
|
Button("All") {
|
||||||
shoeGaze.selectAllBoards(crossfadeSeconds: clampedCrossfade)
|
shoeGaze.selectAllBoards(crossfadeSeconds: clampedCrossfade)
|
||||||
}
|
}
|
||||||
.buttonStyle(.bordered)
|
.buttonStyle(.bordered)
|
||||||
.tint(.orange)
|
.tint(.orange)
|
||||||
.help("Play all boards (summed)")
|
.help("Play all boards (summed)")
|
||||||
|
|
||||||
Text("XFade")
|
|
||||||
.font(.caption2)
|
|
||||||
.foregroundStyle(Color.white.opacity(BoardBarView.labelOpacity))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HStack(spacing: BoardBarView.cellInnerSpacing) {
|
HStack(spacing: BoardBarView.cellInnerSpacing) {
|
||||||
|
Text("XFade")
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundStyle(Color.white.opacity(BoardBarView.labelOpacity))
|
||||||
Slider(
|
Slider(
|
||||||
value: $crossfadeSeconds,
|
value: $crossfadeSeconds,
|
||||||
in: 0 ... BoardBarView.maxCrossfadeSeconds,
|
in: 0 ... BoardBarView.maxCrossfadeSeconds,
|
||||||
step: BoardBarView.crossfadeStep
|
step: BoardBarView.crossfadeStep
|
||||||
)
|
)
|
||||||
|
.frame(minWidth: BoardBarView.crossfadeSliderMinWidth)
|
||||||
Text(String(format: "%.1fs", clampedCrossfade))
|
Text(String(format: "%.1fs", clampedCrossfade))
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
.monospacedDigit()
|
.monospacedDigit()
|
||||||
|
|||||||
@@ -118,8 +118,11 @@ public struct ShoeGazeBuilderView: View {
|
|||||||
boardArea
|
boardArea
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
||||||
|
// Scope + CPU meters sit under the pedal palette, matching its width.
|
||||||
ShoeGazeScopeView(shoeGaze: shoeGaze)
|
ShoeGazeScopeView(shoeGaze: shoeGaze)
|
||||||
|
.frame(width: ShoeGazeBuilderView.sidebarWidth, alignment: .leading)
|
||||||
LyrebirdStatusView(engine: shoeGaze.engine)
|
LyrebirdStatusView(engine: shoeGaze.engine)
|
||||||
|
.frame(width: ShoeGazeBuilderView.sidebarWidth, alignment: .leading)
|
||||||
}
|
}
|
||||||
.padding(ShoeGazeBuilderView.outerPadding)
|
.padding(ShoeGazeBuilderView.outerPadding)
|
||||||
.frame(minWidth: ShoeGazeBuilderView.minWidth, minHeight: ShoeGazeBuilderView.minHeight)
|
.frame(minWidth: ShoeGazeBuilderView.minWidth, minHeight: ShoeGazeBuilderView.minHeight)
|
||||||
|
|||||||
Reference in New Issue
Block a user