iOS: full-screen Now Playing watches the hinge so unfolding goes landscape; build 49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
88d3aa48e7
commit
07b5636bac
2 files changed
+13
-3
No files matched your search
@@ -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<EmptyView>.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<Content: View>: 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.
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user