In macOS Big Sur, the dimensions of the NSSearchField control have changed. For the worst, of course.
Previously, in macOS Mojave or Catalina, when using a small NSSearchField control, you could replace the magnifier icon with a custom icon using:
Now in macOS Big Sur, a 13x13 image is:
As there are no offset properties for NSButtonCell, maybe the issue could be fixed with an image whose contents is incorrectly centered. But I'm not in the mood to try this right now.
Questions:
Previously, in macOS Mojave or Catalina, when using a small NSSearchField control, you could replace the magnifier icon with a custom icon using:
a 13x13 (26x26 @2x) image.
the setSearchButtonCell: API as suggested at
Now in macOS Big Sur, a 13x13 image is:
a little too big
drawn over the top of the bezel of the search field.
As there are no offset properties for NSButtonCell, maybe the issue could be fixed with an image whose contents is incorrectly centered. But I'm not in the mood to try this right now.
Questions:
Is this a known bug?
If this can be solved by using a specific image size, what is this size for a small NSSearchField?
If this can be solved by playing with the searchButtonRectForBounds: method, what is the specific rect that should be returned?