iPad: compact the header, fill portrait, fix palette scroll + sheet padding
- Header: the panel-toggle row and Tempo/Tuner move into the left column under the title (beside the scope + transport), filling the dead vertical space; the top strip is now just the board mixer + CPU meters. - Portrait: the root fills the window and pins top-leading so content is no longer vertically centered with large blank margins. - Add-Pedal sheet: content scrolls instead of resizing the detent (presentationContentInteraction), and a visible toolbar background stops the title drawing over the first rows. - Rigs sheet: add top padding so the "Rigs" title isn't flush to the edge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -237,10 +237,14 @@ public struct ShoeGazeBuilderView: View {
|
||||
rootContent
|
||||
.padding(ShoeGazeBuilderView.outerPadding)
|
||||
// A large min width is a macOS window sizing hint; on iPad it would force content wider than
|
||||
// the screen and clip it, so the sheet-based iPad layout imposes no minimum width.
|
||||
// the screen and clip it, so the sheet-based iPad layout imposes no minimum width. Fill the
|
||||
// whole window and pin to the top-leading corner so portrait isn't vertically centered.
|
||||
.frame(
|
||||
minWidth: isCompact ? nil : ShoeGazeBuilderView.minWidth + ShoeGazeBuilderView.librarySidebarReserve,
|
||||
minHeight: isCompact ? nil : ShoeGazeBuilderView.minHeight
|
||||
maxWidth: isCompact ? .infinity : nil,
|
||||
minHeight: isCompact ? nil : ShoeGazeBuilderView.minHeight,
|
||||
maxHeight: isCompact ? .infinity : nil,
|
||||
alignment: .topLeading
|
||||
)
|
||||
.background(
|
||||
Color(
|
||||
@@ -356,6 +360,7 @@ public struct ShoeGazeBuilderView: View {
|
||||
Color.clear
|
||||
.sheet(isPresented: $showRigsSheet) {
|
||||
rigSidebar
|
||||
.padding(.top, ShoeGazeBuilderView.outerPadding)
|
||||
.presentationDetents([.large])
|
||||
.preferredColorScheme(.dark)
|
||||
}
|
||||
@@ -491,50 +496,67 @@ public struct ShoeGazeBuilderView: View {
|
||||
/// horizontally scrollable row of panel toggles that open the composition sheets.
|
||||
private var compactHeader: some View {
|
||||
_ = transportTick
|
||||
return VStack(alignment: .leading, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
HStack(alignment: .top, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
VStack(alignment: .leading, spacing: 1) {
|
||||
Text("ShoeGaze Builder").font(.headline).bold()
|
||||
.foregroundStyle(Color.white)
|
||||
currentRigLabel
|
||||
// Left column fills the vertical space under the title with the panel/toggle rows; the
|
||||
// right column carries the scope + transport. Top-aligned so nothing floats mid-header.
|
||||
return HStack(alignment: .top, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
VStack(alignment: .leading, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
VStack(alignment: .leading, spacing: 1) {
|
||||
Text("ShoeGaze Builder").font(.headline).bold()
|
||||
.foregroundStyle(Color.white)
|
||||
currentRigLabel
|
||||
}
|
||||
if shoeGaze.isRecording { recordingBadge }
|
||||
}
|
||||
if shoeGaze.isRecording { recordingBadge }
|
||||
Spacer()
|
||||
// A narrow scope sits left of the transport cluster to use the header's dead space.
|
||||
ShoeGazeScopeView(shoeGaze: shoeGaze)
|
||||
.frame(
|
||||
width: ShoeGazeBuilderView.compactHeaderScopeWidth,
|
||||
height: ShoeGazeBuilderView.compactHeaderScopeHeight
|
||||
)
|
||||
// Transport stays on screen (performance): Start / Stop over Record.
|
||||
VStack(alignment: .trailing, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
EngineConfigView(
|
||||
shoeGaze: shoeGaze,
|
||||
hardwareSampleRate: hardwareSampleRate,
|
||||
onConfigApplied: { transportTick.toggle() },
|
||||
transportOnly: true
|
||||
)
|
||||
#if !os(macOS)
|
||||
recordButton
|
||||
#endif
|
||||
|
||||
compactPanelRow
|
||||
|
||||
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
TempoView(shoeGaze: shoeGaze)
|
||||
TunerView(shoeGaze: shoeGaze)
|
||||
}
|
||||
.environment(\.shoeGazeTempoEnabled, shoeGaze.tempoEnabled)
|
||||
}
|
||||
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
compactPanelButton("Rigs", systemImage: "tray.full") { showRigsSheet = true }
|
||||
compactPanelButton("Pedals", systemImage: "plus.app") { showPaletteSheet = true }
|
||||
compactPanelButton("Settings", systemImage: "gearshape") { showSettingsSheet = true }
|
||||
rigBypassButton
|
||||
Toggle("Mute rig", isOn: Binding(
|
||||
get: { shoeGaze.tunerMutesRig },
|
||||
set: { shoeGaze.tunerMutesRig = $0 }
|
||||
))
|
||||
.toggleStyle(.switch)
|
||||
helpButton
|
||||
if let midi: MIDIController = midi {
|
||||
MIDIIndicatorView(controller: midi) { showMIDISheet = true }
|
||||
}
|
||||
Spacer(minLength: ShoeGazeBuilderView.rowSpacing)
|
||||
|
||||
// A narrow scope sits left of the transport cluster to use the header's dead space.
|
||||
ShoeGazeScopeView(shoeGaze: shoeGaze)
|
||||
.frame(
|
||||
width: ShoeGazeBuilderView.compactHeaderScopeWidth,
|
||||
height: ShoeGazeBuilderView.compactHeaderScopeHeight
|
||||
)
|
||||
// Transport stays on screen (performance): Start / Stop over Record.
|
||||
VStack(alignment: .trailing, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
EngineConfigView(
|
||||
shoeGaze: shoeGaze,
|
||||
hardwareSampleRate: hardwareSampleRate,
|
||||
onConfigApplied: { transportTick.toggle() },
|
||||
transportOnly: true
|
||||
)
|
||||
#if !os(macOS)
|
||||
recordButton
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The scrollable row of composition-sheet toggles + rig-wide controls.
|
||||
private var compactPanelRow: some View {
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
compactPanelButton("Rigs", systemImage: "tray.full") { showRigsSheet = true }
|
||||
compactPanelButton("Pedals", systemImage: "plus.app") { showPaletteSheet = true }
|
||||
compactPanelButton("Settings", systemImage: "gearshape") { showSettingsSheet = true }
|
||||
rigBypassButton
|
||||
Toggle("Mute rig", isOn: Binding(
|
||||
get: { shoeGaze.tunerMutesRig },
|
||||
set: { shoeGaze.tunerMutesRig = $0 }
|
||||
))
|
||||
.toggleStyle(.switch)
|
||||
helpButton
|
||||
if let midi: MIDIController = midi {
|
||||
MIDIIndicatorView(controller: midi) { showMIDISheet = true }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -569,16 +591,7 @@ public struct ShoeGazeBuilderView: View {
|
||||
/// Compact top strip: performance monitoring kept on screen — the board switch/mixer bar, the
|
||||
/// scope, and the CPU meters. Tempo / Tuner sit below so they don't crowd the transport row.
|
||||
private var compactTopSection: some View {
|
||||
VStack(alignment: .leading, spacing: ShoeGazeBuilderView.sectionSpacing) {
|
||||
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
TempoView(shoeGaze: shoeGaze)
|
||||
TunerView(shoeGaze: shoeGaze)
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
.environment(\.shoeGazeTempoEnabled, shoeGaze.tempoEnabled)
|
||||
|
||||
Divider().overlay(Color.white.opacity(ShoeGazeBuilderView.dividerOpacity))
|
||||
|
||||
VStack(alignment: .leading, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||
BoardBarView(
|
||||
shoeGaze: shoeGaze,
|
||||
editingBoardIndex: $selectedBoardIndex,
|
||||
@@ -589,7 +602,7 @@ public struct ShoeGazeBuilderView: View {
|
||||
|
||||
Divider().overlay(Color.white.opacity(ShoeGazeBuilderView.dividerOpacity))
|
||||
|
||||
// Scope moved to the header (next to the transport); the CPU meters stay here.
|
||||
// Scope + Tempo/Tuner moved to the header; the CPU meters stay here.
|
||||
LyrebirdStatusView(engine: shoeGaze.engine)
|
||||
}
|
||||
}
|
||||
@@ -606,6 +619,7 @@ public struct ShoeGazeBuilderView: View {
|
||||
.navigationTitle("Add Pedal")
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbarBackground(.visible, for: .navigationBar)
|
||||
#endif
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
@@ -614,6 +628,8 @@ public struct ShoeGazeBuilderView: View {
|
||||
}
|
||||
}
|
||||
.preferredColorScheme(.dark)
|
||||
// Drag inside the list scrolls it instead of resizing the sheet detent.
|
||||
.presentationContentInteraction(.scrolls)
|
||||
}
|
||||
|
||||
/// Engine configuration (sample rate, input/output channel counts, input source), presented as
|
||||
|
||||
Reference in New Issue
Block a user