NSSearchField and search button position

Is it possible, with rectForSearchButtonWhenCentered : to force the search button to stay aligned at the left of the field, even when placeholder is centered (when the field looses focus)?

Or, at least, modify the behavior of the entire field to have all elements aligned at left?
I tried setCentersPlaceholder:false but it makes disappear the buttons.

Any clue?

I don’t understand what you’re asking, however my experience in trying to alter the appearance of search fields makes me inclined to guess that the answer is no. From memory, the behavior also differs with different versions of the OS.

Hi Shane,

Here is what we have whenthe the field gets focus:
The placeholder and the button are aligned left.

And here when it looses focus:
The placeholder and the button are centered.

I would like to have the button (the magnifying glass) alined left when the field does not have focus.
Like this:

Do you think it’s possible?

Honestly, I have no idea (other than subclassing NSSearchFieldCell). But as I said, the behavior varies with OS version — in 10.15, I think what you’re after is the default.

I know that kind of animal. I’ve seen one, once.

More seriously, I’m talking about your Myriad Helpers.
I was able to fairly understand how it works to modify a little bit the NSAlert+ files…
But I know my limitations.

Thanks anyway.
:wink: