OS X 10.10 (14A298i) - NSButtonCell should honor showsBorderOnlyWhileMouseInside again for buttons with NSInlineBezelStyle

Originator:kastansn
Number:rdar://17778326 Date Originated:2014-07-23
Status:Open Resolved:
Product:OS X SDK Product Version:OS X 10.10 (14A298i)
Classification:UI/Usability Reproducible:Always
 
Summary:
With build 14A298i (DP 4) of OS X 10.10 the bezel drawing behavior of NSButtonCell seems to have changed when NSInlineBezelStyle is set for a button:

In previous releases (including even DP 3), the button's bezel would change its color to a darker gray on mouse hover and to an even darker gray on mouse click.
Contrary to previous releases, buttons with inline style now don't seem to change bezel color on mouse hovers, only on mouse clicks. 

Most probably related to this change, the following behavior is now true regardless to what NSButtonCell's showsBorderOnlyWhileMouseInside returns: Before, the developer could make use of NSButtonCell's setShowsBorderOnlyWhileMouseInside: to control if the bezel should be drawn at all when the mouse was not hovering over the button. That doesn't work any more. The bezel is now drawn all the time, regardless of the mouse position. 

While it is desirable that design changes occur with a new version of OS X, long established methods for customizing NSControl drawing should not break.

As a result, please make NSButtonCell respect the showsBorderOnlyWhileMouseInside setting again even when it is set to NSInlineBezelStyle.

Another side effect I noticed is that the bezel's color is of a slightly darker shade of gray after it has been clicked for the first time.

Steps to Reproduce:
1. Create an OS X app (Objective C) with a window and a button
2. In Interface Builder's Attribute Inspector, set the button's style to "Inline" and make sure it is also bordered and enabled
3. Create a subclass of NSButtonCell and name it "MyButtonCell"
4. In the implementation of this class, overwrite -(BOOL)showsBorderOnlyWhileMouseInside and make it always return YES
5. In Interface Builder's Identity Inspector, set the button cell's class to this newly created custom class "MyButtonCell"
6. Build and run and move the mouse pointer over the inline button

Expected Results:
The button should only draw a bezel on mouse hover.

Actual Results:
The button draws its bezel all the time, regardless of mouse position. Also it changes its color very subtly after having been clicked for the first time.

Version:
Xcode DP4 Version 6.0 (6A267n) and also Xcode DP 3
OS X 10.10 (14A298i)

Notes:
A possible workaround is to overwrite NSButtonCell's drawWithFrame:inView: in order to control independently when drawBezelWithFrame:inView: should be called.

Configuration:
This bug occurs since OS X 10.10 Developer Preview 4 (14A298i). It didn't occur on previous releases of OS X, including Developer Preview 3.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!