iOS: Duo layout fixes for every fold and orientation
- Split panes get portrait-phone traits (regular height, compact width), so unfolded landscape no longer stacks nav bar buttons down the pane's trailing edge, eating its width and sliding under the rail when swapped. - Wide Now Playing column never drops below what the transport needs; the transport shrinks when narrow instead of spilling onto the art and under the rail (landscape folded, portrait unfolded). - Stacked Now Playing controls match the art's width. - Docked wide art gets a smaller inset so it fills more of the pane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
02f8452be2
commit
2d7ee03626
2 files changed
+49
-19
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
enum Tab: String, CaseIterable, Hashable {
|
||||
case Library, Songs, Albums, Artists, Genres, Playlists, Search, Downloads, Settings
|
||||
@@ -103,6 +104,18 @@ final class Ui {
|
||||
// Only an iPhone Duo ever splits, so from here on folded Now Playing uses its tighter layout.
|
||||
UserDefaults.standard.set(true, forKey: "duoSeen")
|
||||
}
|
||||
// Each pane is phone-sized, so give it portrait-phone traits. Unfolded landscape is
|
||||
// otherwise compact-height, which moves nav bar buttons into a column down the pane's
|
||||
// trailing edge (eating its width, and landing under the rail on the right pane).
|
||||
for case let scene as UIWindowScene in UIApplication.shared.connectedScenes {
|
||||
if on {
|
||||
scene.traitOverrides.verticalSizeClass = .regular
|
||||
scene.traitOverrides.horizontalSizeClass = .compact
|
||||
} else {
|
||||
scene.traitOverrides.remove(UITraitVerticalSizeClass.self)
|
||||
scene.traitOverrides.remove(UITraitHorizontalSizeClass.self)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Switches to the Library tab and pushes [r] there.
|
||||
|
||||
Reference in new issue
Block a user