Avoid stoplight buttons on camera in windowed mode on iPad

This commit is contained in:
Elaine 2026-04-02 20:21:33 -04:00 committed by GitHub
parent be0a80eb8e
commit 9455ece532
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,13 @@ open class MediaTopBar: UIView {
// since `preservesSuperviewLayoutMargins` is set to `true`.
public let controlsLayoutGuide = UILayoutGuide()
private lazy var controlsLayoutGuideTop: NSLayoutConstraint = {
controlsLayoutGuide.topAnchor.constraint(equalTo: topAnchor)
if #available(iOS 26, *) {
// Avoid stoplight buttons in windowed mode on iPad
let guide = layoutGuide(for: .margins(cornerAdaptation: .vertical))
return controlsLayoutGuide.topAnchor.constraint(equalTo: guide.topAnchor)
} else {
return controlsLayoutGuide.topAnchor.constraint(equalTo: topAnchor)
}
}()
private lazy var controlsLayoutGuideLeading: NSLayoutConstraint = {