macOS Big Sur new toolbar button style

Viewed 2457

When I create an App with SwiftUI App Lifecycle the toolbar buttons match with the new Big Sur toolbar button style (with onHover effect style). But if I choose the conventional AppDelegate Lifecycle and customize the toolbar via Storyboards then I get this button style without onHover effect:

enter image description here

The button appears with a rectangle as background. Does anyone know how could I achieve the new style?

3 Answers

I've got this effect after I set NSButton.showsBorderOnlyWhileMouseInside property.

button.setButtonType(.momentaryPushIn)
button.isBordered = true
button.showsBorderOnlyWhileMouseInside = true

result

toolbarItem.isBordered = true

isBordered property will give you that hover effect.

I've just had this problem myself and found the following NSButton settings to work.

Button style = Textured Rounded  
Type = Momentary Light
Related