diff --git a/ios/Stemify/UI/RootView.swift b/ios/Stemify/UI/RootView.swift index af73fa7..e044519 100644 --- a/ios/Stemify/UI/RootView.swift +++ b/ios/Stemify/UI/RootView.swift @@ -24,6 +24,16 @@ struct RootView: View { } .fullScreenCover(isPresented: Binding(get: { ui.nowPlayingOpen }, set: { ui.nowPlayingOpen = $0 })) { NowPlayingScreen() + // The panes underneath stop reporting while this covers them, so watch for the + // hinge here too: unfolding hands over to the split (docked) layout. + .background(GeometryReader { geo in + let c = DuoPane.cut(geo) + Color.clear.onChange(of: c == nil ? 0 : c!.vertical ? 2 : 1, initial: true) { _, k in + guard k > 0 else { return } + ui.setUnfolded(true) + ui.setSplit(k == 2) + } + }) .overlayHost(ui.overlays, level: 1) .environment(ui) .environment(\.palette, p) @@ -242,9 +252,9 @@ private struct DuoPane: View { } /// Where the hinge cuts the view: sizes of the two sides and the gap between them. - private struct Cut { var vertical: Bool; var first: CGFloat; var gap: CGFloat; var second: CGFloat } + fileprivate struct Cut { var vertical: Bool; var first: CGFloat; var gap: CGFloat; var second: CGFloat } - private static func cut(_ geo: GeometryProxy) -> Cut? { + fileprivate static func cut(_ geo: GeometryProxy) -> Cut? { let size = geo.size var c: Cut? // The hinge reports inactive while the phone lies flat, so ask for inactive regions too. diff --git a/ios/project.yml b/ios/project.yml index 7e184c1..c703fc4 100644 --- a/ios/project.yml +++ b/ios/project.yml @@ -9,7 +9,7 @@ settings: # iOS needs a plain number for the bundle version; the label is what the app and releases show. MARKETING_VERSION: "0.10.1" VERSION_LABEL: "0.10.1" - CURRENT_PROJECT_VERSION: "48" + CURRENT_PROJECT_VERSION: "49" # Dev builds override these (build-ipa.sh dev) so they install next to the release app. APP_ID: org.cdnutter.stemify APP_NAME: Stemify