Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29a1742f8d | ||
|
|
09bf1b2835 |
No files matched your search
@@ -304,11 +304,15 @@ struct Page<Content: View>: View {
|
||||
var large = true
|
||||
@ViewBuilder let content: () -> Content
|
||||
@Environment(\.palette) private var p
|
||||
@Environment(Ui.self) private var ui
|
||||
@AppStorage("duoSwap") private var swap = false
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
LazyVStack(alignment: .leading, spacing: 0) { content() }
|
||||
.padding(.bottom, 24)
|
||||
}
|
||||
// Split at the iPhone Duo's hinge, rows run right up to it (no inset is real on that side).
|
||||
.ignoresSafeArea(.container, edges: ui.split ? (swap ? .leading : .trailing) : [])
|
||||
.background(p.bg)
|
||||
.navigationTitle(title)
|
||||
.navigationBarTitleDisplayMode(large ? .large : .inline)
|
||||
|
||||
@@ -125,8 +125,6 @@ final class Ui {
|
||||
split = on
|
||||
if on {
|
||||
nowPlayingOpen = false
|
||||
// Only an iPhone Duo ever splits, so from here on folded Now Playing uses its tighter layout.
|
||||
UserDefaults.standard.set(true, forKey: "duoSeen")
|
||||
}
|
||||
// Karaoke left on shows its lyrics in the deck.
|
||||
if on && AppGraph.shared.playback.karaoke { deckPage = .Lyrics } else if deckPage == .Lyrics { deckPage = .Stems }
|
||||
|
||||
@@ -144,20 +144,6 @@ private struct MiniPlayerRoom: ViewModifier {
|
||||
content.safeAreaInset(edge: .bottom, spacing: 0) {
|
||||
if !glassAccessory && !ui.split && g.playback.current != nil { Color.clear.frame(height: 66) }
|
||||
}
|
||||
.modifier(PaneToolbar())
|
||||
}
|
||||
}
|
||||
|
||||
/// Split, each pane is phone-sized, so its nav bar stays across the top instead of moving into
|
||||
/// the Duo's vertical bar (the tab bar still goes there).
|
||||
private struct PaneToolbar: ViewModifier {
|
||||
@Environment(Ui.self) private var ui
|
||||
func body(content: Content) -> some View {
|
||||
if #available(iOS 27.1, *) {
|
||||
content.toolbarVerticalBehavior(ui.split ? .disabled : .automatic)
|
||||
} else {
|
||||
content
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,6 +170,10 @@ private struct DuoPane<Content: View>: View {
|
||||
layout {
|
||||
content
|
||||
.environment(\.layoutDirection, .leftToRight)
|
||||
// The tab's navigation picks up the window's right-hand inset (the status column)
|
||||
// even though it ends at the hinge, so the bar and rows stopped short of it. The
|
||||
// hinge side never needs an inset.
|
||||
.ignoresSafeArea(.container, edges: cut?.vertical == true ? (flip ? .leading : .trailing) : [])
|
||||
.frame(width: cut.map { $0.vertical ? (flip ? $0.second : $0.first) : geo.size.width } ?? geo.size.width,
|
||||
height: cut.map { $0.vertical ? geo.size.height : $0.first } ?? geo.size.height)
|
||||
if let cut {
|
||||
|
||||
@@ -108,14 +108,14 @@ struct NowPlayingScreen: View {
|
||||
@State private var tint: Color?
|
||||
/// How far the screen is being dragged down to close it.
|
||||
@State private var drop: CGFloat = 0
|
||||
/// Set once the phone has unfolded, so it's an iPhone Duo: its screens are shorter for their
|
||||
/// width than a regular iPhone's, so the controls pack tighter and the art gets the room.
|
||||
@AppStorage("duoSeen") private var duoSeen = false
|
||||
private var tight: Bool { docked || duoSeen }
|
||||
/// Docked beside the hinge the pane is narrow, so the controls pack tighter. Full screen
|
||||
/// (folded or any other iPhone) uses the roomy layout across the whole window.
|
||||
private var tight: Bool { docked }
|
||||
/// Size of the art panel in the stacked layout, so the controls can match the art's width.
|
||||
@State private var artBox: CGSize = .zero
|
||||
/// The screen's height, for the strip at the top that a drag down closes from.
|
||||
@State private var screenH: CGFloat = 0
|
||||
@Environment(\.verticalSizeClass) private var vSize
|
||||
private var artInset: CGFloat { tight ? 18 : 28 }
|
||||
private var hPad: CGFloat { tight ? 20 : 28 }
|
||||
private var g: AppGraph { .shared }
|
||||
@@ -147,7 +147,7 @@ struct NowPlayingScreen: View {
|
||||
// Controls line up with the art's edges instead of running wider than it.
|
||||
let art = min(artBox.width - 2 * artInset, artBox.height - 16)
|
||||
// Every panel keeps the art screen's width, so switching to the stems doesn't widen it.
|
||||
let w = art > 0 ? min(cap, max(300, art + 2 * hPad)) : cap
|
||||
let w = !docked ? geo.size.width : art > 0 ? min(cap, max(300, art + 2 * hPad)) : cap
|
||||
VStack(spacing: 0) {
|
||||
panelView(track, header: true)
|
||||
.frame(maxWidth: panel == .Art ? .infinity : min(w, geo.size.width), maxHeight: .infinity)
|
||||
@@ -162,6 +162,10 @@ struct NowPlayingScreen: View {
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
// Folded, the iPhone Duo keeps a status column down the right edge. Run the player under it
|
||||
// (it only overlaps the sliding preset chips) instead of leaving a quarter of the screen empty.
|
||||
// Upright iPhones have no side insets, so this only changes the Duo.
|
||||
.ignoresSafeArea(.container, edges: !docked && vSize == .regular ? .trailing : [])
|
||||
.padding(.top, docked ? 4 : tight ? 14 : 20)
|
||||
.padding(.bottom, tight ? 4 : 8)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
@@ -738,6 +742,8 @@ private struct MixerPanel: View {
|
||||
.padding(.horizontal, -24)
|
||||
.padding(.vertical, 8)
|
||||
}
|
||||
// Any height the rows can't use goes evenly above and below them, so the stems sit centred.
|
||||
Spacer(minLength: 0)
|
||||
// The meters' fall is timed, so 30 fps looks the same and costs a quarter of 120.
|
||||
TimelineView(.animation(minimumInterval: 1 / 30, paused: !stems || !pm.playWhenReady)) { _ in
|
||||
let levels = stems ? meters.step(pm.engine, names.count) : []
|
||||
@@ -750,6 +756,7 @@ private struct MixerPanel: View {
|
||||
Spacer(minLength: 8)
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
.frame(minHeight: geo.size.height)
|
||||
}
|
||||
.scrollIndicators(.hidden)
|
||||
// Holds still when everything fits, so a drag down closes Now Playing instead.
|
||||
@@ -815,7 +822,7 @@ extension MixerPanel {
|
||||
/// Shortest stacked row: name line, fader and the gap under it.
|
||||
static let roomyMin: CGFloat = 60
|
||||
/// Shortest side-by-side row, the fader's own height.
|
||||
static let compactMin: CGFloat = 36
|
||||
static let compactMin: CGFloat = 30
|
||||
/// Preset chips plus the bottom gap.
|
||||
static let roomyChrome: CGFloat = 56
|
||||
static let compactChrome: CGFloat = 56
|
||||
|
||||
+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.9.0"
|
||||
VERSION_LABEL: "0.9.0"
|
||||
CURRENT_PROJECT_VERSION: "27"
|
||||
CURRENT_PROJECT_VERSION: "29"
|
||||
# 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