Skip to content

Commit 4b74c87

Browse files
[PM-25567] Fix profile switcher icon color on pre-iOS 26 (#1992)
1 parent ad6308f commit 4b74c87

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherToolbarView.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ struct ProfileSwitcherToolbarView: View {
1616

1717
/// The Toolbar item for the profile switcher view
1818
@ViewBuilder var profileSwitcherToolbarItem: some View {
19-
let color = store.state.showPlaceholderToolbarIcon
19+
let tintColor = store.state.showPlaceholderToolbarIcon
2020
? nil
2121
: store.state.activeAccountProfile?.color
22+
// iOS 26+ uses the tint color on liquid glass to give the button its color. Prior to iOS 26,
23+
// the button's background is colored in `profileSwitcherIcon`.
24+
let iconColor: Color? = if #available(iOS 26, *) { nil } else { tintColor }
25+
2226
let iconSize: ProfileSwitcherIconSize = if #available(iOS 26, *) { .toolbar } else { .standard }
2327
// On iOS 26+, remove extra padding applied around the button, which allows the initials
2428
// font size to scale larger without increasing the overall width of the button.
@@ -28,7 +32,7 @@ struct ProfileSwitcherToolbarView: View {
2832
await store.perform(.requestedProfileSwitcher(visible: !store.state.isVisible))
2933
} label: {
3034
profileSwitcherIcon(
31-
color: nil,
35+
color: iconColor,
3236
initials: store.state.showPlaceholderToolbarIcon
3337
? nil
3438
: store.state.activeAccountProfile?.userInitials,
@@ -39,7 +43,7 @@ struct ProfileSwitcherToolbarView: View {
3943
)
4044
}
4145
.backport.buttonStyleGlassProminent()
42-
.tint(color ?? SharedAsset.Colors.backgroundTertiary.swiftUIColor)
46+
.tint(tintColor ?? SharedAsset.Colors.backgroundTertiary.swiftUIColor)
4347
.padding(.horizontal, horizontalPadding)
4448
.accessibilityIdentifier("CurrentActiveAccount")
4549
.accessibilityLabel(Localizations.account)

0 commit comments

Comments
 (0)