iOS Demo: host the builder directly, filled (fix portrait centering)
ShoeGazeBuilderiOSApp wrapped the builder in a NavigationStack with its own title, duplicating the builder's header and leaving the content vertically centered in portrait. Host ShoeGazeBuilderView directly with a fill frame and no NavigationStack/title — the builder provides its own chrome and scroll regions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,9 @@ import LyrebirdShoeGazeUI
|
|||||||
/// lifetime of the app. The audio engine is **not** started automatically — the user presses
|
/// lifetime of the app. The audio engine is **not** started automatically — the user presses
|
||||||
/// Start in ``ShoeGazeBuilderView``. The engine is stopped when the view disappears.
|
/// Start in ``ShoeGazeBuilderView``. The engine is stopped when the view disappears.
|
||||||
///
|
///
|
||||||
/// ``ShoeGazeBuilderView`` manages its own scroll regions (palette + builder), so it is hosted
|
/// ``ShoeGazeBuilderView`` draws its own header/title and manages its own scroll regions (palette
|
||||||
/// directly rather than wrapped in an outer `ScrollView`.
|
/// + board canvas), so it is hosted directly — no `NavigationStack`, title, or outer `ScrollView`.
|
||||||
|
/// A fill frame keeps it pinned to the full window so portrait isn't vertically centered.
|
||||||
@main
|
@main
|
||||||
struct ShoeGazeBuilderiOSApp: App {
|
struct ShoeGazeBuilderiOSApp: App {
|
||||||
|
|
||||||
@@ -23,20 +24,17 @@ struct ShoeGazeBuilderiOSApp: App {
|
|||||||
|
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
WindowGroup {
|
WindowGroup {
|
||||||
NavigationStack {
|
ShoeGazeBuilderView(
|
||||||
ShoeGazeBuilderView(
|
shoeGaze: model.shoeGaze,
|
||||||
shoeGaze: model.shoeGaze,
|
library: model.library,
|
||||||
library: model.library,
|
hardwareSampleRate: { model.hardwareSampleRate },
|
||||||
hardwareSampleRate: { model.hardwareSampleRate },
|
onEnableLiveInput: { model.enableLiveInput() },
|
||||||
onEnableLiveInput: { model.enableLiveInput() },
|
midi: model.midi
|
||||||
midi: model.midi
|
)
|
||||||
)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
.navigationTitle("ShoeGaze Builder")
|
.task { await model.startLibrary() }
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.onDisappear { model.stop() }
|
||||||
.task { await model.startLibrary() }
|
.onOpenURL { url in model.importDocument(at: url) }
|
||||||
}
|
|
||||||
.onDisappear { model.stop() }
|
|
||||||
.onOpenURL { url in model.importDocument(at: url) }
|
|
||||||
}
|
}
|
||||||
.onChange(of: scenePhase) { _, phase in
|
.onChange(of: scenePhase) { _, phase in
|
||||||
// Persist the rig whenever the app leaves the foreground.
|
// Persist the rig whenever the app leaves the foreground.
|
||||||
|
|||||||
Reference in New Issue
Block a user