2

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.

Bryan
  • 4,628
  • 3
  • 36
  • 62

1 Answers1

6

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.

Marc Edwards
  • 1,318
  • 10
  • 12
  • Works perfectly! I had to move some custom drawing code out of -drawBezelWithFrame:inView (because that method is no longer called with isBordered off). But this has definitely fixed the problem. Thanks! – Bryan Oct 27 '14 at 18:18
  • 2
    Note: if you use this method, prepare for a bunch of cursing. Turned off -isBordered will cause AppKit to drop the popUpButton's frame height. At "small" size, the button goes from 22px tall to 18px tall. This screws up all the custom drawing. ...There are days I just want to line up every Cocoa engineer and punch them directly in the face. – Bryan Oct 28 '14 at 02:12
  • I ended up editing the *.xib XML directly to change my button heights back to 22px. The real kicker is that IB set SOME of them to 18px tall and left others at 22px as I changed -isBordered to false. – Bryan Oct 28 '14 at 02:23