import SwiftUI struct ControlsOverlayButton: View { var focusedField: FocusState.Binding var field: ControlsOverlay.Field let label: LabelView init( focusedField: FocusState.Binding, field: ControlsOverlay.Field, @ViewBuilder label: @escaping () -> LabelView ) { self.focusedField = focusedField self.field = field self.label = label() } var body: some View { label .padding() .frame(width: 400) .focusable() .focused(focusedField, equals: field) .background(focusedField.wrappedValue == field ? Color.white : Color.secondary) .foregroundColor(focusedField.wrappedValue == field ? Color.black : Color.white) .clipShape(RoundedRectangle(cornerRadius: 4)) } }