Search code examples
objective-cmacoscocoaappkitnspopupbutton

Disable/Customize NSPopUpButton animation in 10.10 Yosemite


Context:

In OS 10.10, Apple added some new subtle animations to various controls. For example, when you check a checkbox, the blue "checked" state now animates in by expanding outward from the center of the checkbox rather than abruptly switching to the "checked" image.

Similarly, when you open an NSPopUpButton and choose an item from the menu, the menu animates closed and the selected item appears to "zoom into" the popUpButton.

The Problem:

I have customized NSPopUpButtons that draw themselves differently than the default NSPopUpButton:

enter image description here

When I select an item in the pop-up menu, the new animation in 10.10 briefly shows the system-default popUpButton style while animating in (blue right-hand side, etc.).

Here's a screenshot of the animation in progress, showing the system-default popUpButton animating in. (The dark-grey rectangle in the back is the "pressed" state of my custom NSPopUpButton):

enter image description here

What I Need

This animation obviously looks terrible with customized controls. Is there any way to disable it or to customize it? I have been unable to find one.


Solution

  • Turning off the Bordered property in Interface Builder seems to do the trick.

    enter image description here

    Here’s a comparison of Bordered on and Bordered off.

    enter image description here

    Please note that the Bordered property was showing as being off by default, when it’s actually on. I just had to check then uncheck it to disable it.