iPad: drop the header scope to a full-width strip below the rows in portrait
On narrower portrait widths (smaller iPads / split view) the inline scope overlaid and clipped the header. Detect portrait by actual size (iPad is .regular in both orientations) and, in portrait, move the scope to a full-width strip beneath the control rows — using the ample portrait vertical space. Landscape keeps it inline beside the transport. Header control rows + transport factored into shared subviews. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -176,6 +176,12 @@ public struct ShoeGazeBuilderView: View {
|
|||||||
/// Type filter for the compact Add-Pedal sheet, hoisted so it sits in the sheet's fixed header.
|
/// Type filter for the compact Add-Pedal sheet, hoisted so it sits in the sheet's fixed header.
|
||||||
@State private var pedalFilter: PedalCategory?
|
@State private var pedalFilter: PedalCategory?
|
||||||
|
|
||||||
|
/// `true` when the window is taller than it is wide (portrait). iPad is `.regular` in both
|
||||||
|
/// orientations, so this is derived from the actual size, not the size class. In portrait the
|
||||||
|
/// header scope moves to a full-width strip below the controls (it would otherwise overlay /
|
||||||
|
/// clip the header on narrower iPads); landscape keeps it inline beside the transport.
|
||||||
|
@State private var isPortrait: Bool = false
|
||||||
|
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
/// iOS recording-folder picker presentation flag. (macOS uses the Record menu.)
|
/// iOS recording-folder picker presentation flag. (macOS uses the Record menu.)
|
||||||
@State private var showRecordingFolderImporter: Bool = false
|
@State private var showRecordingFolderImporter: Bool = false
|
||||||
@@ -258,6 +264,14 @@ public struct ShoeGazeBuilderView: View {
|
|||||||
blue: ShoeGazeBuilderView.backgroundBlue
|
blue: ShoeGazeBuilderView.backgroundBlue
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
// Track portrait vs landscape by actual size (iPad is `.regular` in both orientations).
|
||||||
|
.background(
|
||||||
|
GeometryReader { proxy in
|
||||||
|
Color.clear.task(id: proxy.size) {
|
||||||
|
isPortrait = proxy.size.height > proxy.size.width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
// The builder is always dark-themed; force the dark scheme so system controls (nav title,
|
// The builder is always dark-themed; force the dark scheme so system controls (nav title,
|
||||||
// steppers, the Record button) use light text instead of black-on-dark in light mode.
|
// steppers, the Record button) use light text instead of black-on-dark in light mode.
|
||||||
.preferredColorScheme(.dark)
|
.preferredColorScheme(.dark)
|
||||||
@@ -500,12 +514,31 @@ public struct ShoeGazeBuilderView: View {
|
|||||||
/// horizontally scrollable row of panel toggles that open the composition sheets.
|
/// horizontally scrollable row of panel toggles that open the composition sheets.
|
||||||
private var compactHeader: some View {
|
private var compactHeader: some View {
|
||||||
_ = transportTick
|
_ = transportTick
|
||||||
// Left column stacks the three tight rows; scope + transport form a right column spanning
|
// The three control rows stack tight on the left; the transport sits top-right. The scope
|
||||||
// them, so the tall scope no longer sets row 1's height (which opened a gap above row 2).
|
// is inline (right, spanning the rows) in landscape, but on narrower portrait widths it
|
||||||
// Row 1: title · [Bypass · Mute · Help · MIDI filling to the scope]
|
// would overlay/clip the header — so there it drops to a full-width strip below the rows.
|
||||||
// Row 2: Tempo · Tuner
|
// Row 1: title · [Bypass · Mute · Help · MIDI] Row 2: Tempo · Tuner Row 3: Rigs/Pedals/Settings
|
||||||
// Row 3: Rigs · Pedals · Settings
|
return VStack(alignment: .leading, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||||
return HStack(alignment: .top, spacing: ShoeGazeBuilderView.rowSpacing) {
|
HStack(alignment: .top, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||||
|
headerControlRows
|
||||||
|
|
||||||
|
if !isPortrait {
|
||||||
|
headerScope
|
||||||
|
.frame(width: ShoeGazeBuilderView.compactHeaderScopeWidth)
|
||||||
|
}
|
||||||
|
|
||||||
|
headerTransport
|
||||||
|
}
|
||||||
|
|
||||||
|
if isPortrait {
|
||||||
|
headerScope
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The three stacked control rows shared by both orientations.
|
||||||
|
private var headerControlRows: some View {
|
||||||
VStack(alignment: .leading, spacing: ShoeGazeBuilderView.rowSpacing) {
|
VStack(alignment: .leading, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||||
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
|
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||||
VStack(alignment: .leading, spacing: 1) {
|
VStack(alignment: .leading, spacing: 1) {
|
||||||
@@ -525,14 +558,18 @@ public struct ShoeGazeBuilderView: View {
|
|||||||
|
|
||||||
compactPanelRow
|
compactPanelRow
|
||||||
}
|
}
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
}
|
||||||
|
|
||||||
// A narrow scope sits left of the transport cluster to use the header's dead space.
|
/// The oscilloscope, sized to the shared header height. Its width is set by the caller
|
||||||
|
/// (fixed inline in landscape, full-width strip in portrait).
|
||||||
|
private var headerScope: some View {
|
||||||
ShoeGazeScopeView(shoeGaze: shoeGaze)
|
ShoeGazeScopeView(shoeGaze: shoeGaze)
|
||||||
.frame(
|
.frame(height: ShoeGazeBuilderView.compactHeaderScopeHeight)
|
||||||
width: ShoeGazeBuilderView.compactHeaderScopeWidth,
|
}
|
||||||
height: ShoeGazeBuilderView.compactHeaderScopeHeight
|
|
||||||
)
|
/// The Start / Stop over Record transport cluster (top-right in both orientations).
|
||||||
// Transport stays on screen (performance): Start / Stop over Record.
|
private var headerTransport: some View {
|
||||||
VStack(alignment: .trailing, spacing: ShoeGazeBuilderView.rowSpacing) {
|
VStack(alignment: .trailing, spacing: ShoeGazeBuilderView.rowSpacing) {
|
||||||
EngineConfigView(
|
EngineConfigView(
|
||||||
shoeGaze: shoeGaze,
|
shoeGaze: shoeGaze,
|
||||||
@@ -545,7 +582,6 @@ public struct ShoeGazeBuilderView: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// The rig-wide controls shown inline on the title row: Bypass / Mute / Help / MIDI.
|
/// The rig-wide controls shown inline on the title row: Bypass / Mute / Help / MIDI.
|
||||||
private var compactRigControlsRow: some View {
|
private var compactRigControlsRow: some View {
|
||||||
|
|||||||
Reference in New Issue
Block a user