When a Menu is placed inside a ToolbarItem, applying
buttonStyle(.glassProminent) has no visible effect.
The same modifier works correctly when a Button is used instead of a Menu inside the ToolbarItem. In that case, the button is rendered with the accent-colored background as expected.
This suggests that Menu does not respect the .glassProminent button style when embedded in a ToolbarItem, even though other button types do.
Code Example
// Button with accent background color
.toolbar {
ToolbarItem(placement: .primaryAction) {
Button(action: {})
.buttonStyle(.glassProminent)
}
}
// Menu with internal button with no accent background color
.toolbar {
ToolbarItem(placement: .primaryAction) {
Menu(...) {
...
}.buttonStyle(.glassProminent)
}
}