Compare commits

...
Author SHA1 Message Date
rootandClaude Opus 5.5 9f68aa588b Dev 35: Duo orientation lock, folded portrait only, unfolded landscape only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:41:59 -08:00
rootandClaude Opus 5.5 406895a3f0 Dev 34: left-aligned art only when folded
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:36:54 -08:00
4 changed files with 18 additions and 7 deletions

No files matched your search

+3 -3
View File
@@ -34,13 +34,13 @@ final class AppDelegate: NSObject, UIApplicationDelegate {
enum Orientation {
nonisolated(unsafe) static var mask: UIInterfaceOrientationMask = .allButUpsideDown
@MainActor static func lock(_ upright: Bool) {
let m: UIInterfaceOrientationMask = upright ? .portrait : .allButUpsideDown
/// Folded Duo: portrait only. Unfolded Duo: landscape only. Anything else turns freely.
@MainActor static func lock(_ m: UIInterfaceOrientationMask) {
guard m != mask else { return }
mask = m
for case let scene as UIWindowScene in UIApplication.shared.connectedScenes {
scene.keyWindow?.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations()
if upright { scene.requestGeometryUpdate(.iOS(interfaceOrientations: .portrait)) { _ in } }
if m != .allButUpsideDown { scene.requestGeometryUpdate(.iOS(interfaceOrientations: m)) { _ in } }
}
}
}
+13 -2
View File
@@ -131,13 +131,24 @@ final class Ui {
duo = true
UserDefaults.standard.set(true, forKey: "duoSeen")
}
Orientation.lock(folded)
lockOrientation()
}
/// Split (unfolded) goes landscape at once. Portrait waits a moment and checks again, so a
/// frame without a hinge reading mid-rotation can't throw an unfolded phone back upright.
private func lockOrientation() {
if split { Orientation.lock(.landscape); return }
guard folded else { Orientation.lock(.allButUpsideDown); return }
Task { @MainActor in
try? await Task.sleep(for: .milliseconds(400))
if self.folded { Orientation.lock(.portrait) }
}
}
func setSplit(_ on: Bool) {
guard on != split else { return }
split = on
Orientation.lock(folded)
lockOrientation()
if on {
nowPlayingOpen = false
}
@@ -202,7 +202,7 @@ struct NowPlayingScreen: View {
private func panelView(_ track: Track, header: Bool) -> some View {
switch panel {
case .Art: ArtPanel(thumb: track.thumb, playing: g.playback.playWhenReady, inset: header || !tight ? artInset : 12,
leading: folded && g.settings.foldedArtLeft).contentShape(Rectangle())
leading: folded && !docked && !ui.split && g.settings.foldedArtLeft).contentShape(Rectangle())
case .Mixer: VStack(spacing: 0) { if header { mini(track) }; MixerPanel(spread: folded) }
case .Queue: VStack(spacing: 0) { if header { mini(track) }; QueuePanel(close: { show(.Queue) }) }
case .Lyrics: VStack(spacing: 0) { if header { mini(track) }; LyricsPanel(track: track) }
+1 -1
View File
@@ -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.9.0"
VERSION_LABEL: "0.9.0"
CURRENT_PROJECT_VERSION: "33"
CURRENT_PROJECT_VERSION: "35"
# Dev builds override these (build-ipa.sh dev) so they install next to the release app.
APP_ID: org.cdnutter.stemify
APP_NAME: Stemify