From 375d98e0b51625cb380ccc0a0bc737321e7cc642 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Tue, 22 Sep 2026 13:27:08 +0100 Subject: [PATCH] Fix HDR UI bugs on iOS 27.0. (#6177) --- .../Sources/Other/SwiftUI/Views/LoadableAvatarImage.swift | 7 +++++-- ElementX/Sources/Other/SwiftUI/Views/ToolbarButton.swift | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ElementX/Sources/Other/SwiftUI/Views/LoadableAvatarImage.swift b/ElementX/Sources/Other/SwiftUI/Views/LoadableAvatarImage.swift index 13c24dd7e..238679aec 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/LoadableAvatarImage.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/LoadableAvatarImage.swift @@ -58,9 +58,12 @@ struct LoadableAvatarImage: View { private var clippedAvatar: some View { avatar .frame(width: frameSize, height: frameSize) - .background(Color.compound.bgCanvasDefault) + .background { + Color.compound.bgCanvasDefault + .allowedDynamicRange(.standard) // Workaround an iOS 27.0 bug where full white goes HDR in a toolbar. + } .avatarShape(shape, scaledSize: _frameSize) - .allowedDynamicRange(.standard) // Prevent avatars from triggering HDR display. + .allowedDynamicRange(.standard) // Prevent loaded avatars from triggering HDR display. .environment(\.shouldAutomaticallyLoadImages, true) // We always load avatars. } diff --git a/ElementX/Sources/Other/SwiftUI/Views/ToolbarButton.swift b/ElementX/Sources/Other/SwiftUI/Views/ToolbarButton.swift index 28a3c974f..fd41d0161 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/ToolbarButton.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/ToolbarButton.swift @@ -44,7 +44,7 @@ struct ToolbarButton: View { var tint: Color { switch self { case .cancel: - .compound.bgCanvasDefault + .clear case .confirm: .compound.bgAccentRest case .destructive: