Why does my NSBox draw a background? (boxType = .primary)

203 views Asked by At

I realized that suddenly (without me touching the corresponding code) my NSBox has a double visualization. It is as if the Box has a background color and draws its normal rounded frame inside. I added a small screenshot. The parent control is white, the NSBox is gray with the title "Inputs" (unchanged titlePosition). Under the title is the normal box, adding a 2nd shade of gray.

A NSBox with a double frame

I did not change any of the usual suspects, especially not boxType which is still set to .primary.

I did work on the Dark Mode (Dark Aqua) but cannot see any change that would cause this behaviour. effectiveAppearance is still Aqua.

1

There are 1 answers

2
Marc T. On

A NSBox with a boxType of .primary always draws a background. That is intended behaviour. Only if the view behind NSBox is white you may not see it. If you want a NSBox without background you must make it boxType .custom and set the background color as required.