How to get an NSSegmentedControl in toolbar look like in the Finder?

Hey Team,

In the Finder, the segmented control in the toolbar where the user can choose to display the files as icons, list, columns, or gallery, indicates its selection using a gray background.

Is that done via custom drawing or is it a semantic option in AppKit?

When I adopt Liquid Glass in my app by removing UIDesignRequiresCompatibility, my segmented control indicates the selections with a strong accent color. This could be distracting to my users and I'd like to duplicate the Finder behavior.

Thanks, Ari

Answered by Frameworks Engineer in 892298022

Thanks for your question!

NSSegmentedControl in the toolbar has a gray selection background when the tracking mode is .selectOne and an accent color selection background when the tracking mode is .selectAny. The accent color indicates that the segment is toggled on.

I'd also like to know this for push-on push-off buttons – thanks !

Accepted Answer

Thanks for your question!

NSSegmentedControl in the toolbar has a gray selection background when the tracking mode is .selectOne and an accent color selection background when the tracking mode is .selectAny. The accent color indicates that the segment is toggled on.

How to get an NSSegmentedControl in toolbar look like in the Finder?
 
 
Q