tags:

views:

52

answers:

1

The Apple Human Interface Guidelines say:

In the Downloads window, Safari uses the free-standing NSImageNameStopProgressFreestandingTemplate image inline with a progress indicator to allow users to stop an in-progress download.

Safari Downloads Window

The NSImage documentation says something similar. However, creating an NSButton using NSImageNameStopProgressFreestandingTemplate and NSShadowlessSquareBezelStyle produces something like this:

NSImageNameStopProgressFreestandingTemplate

Unfortunately, this button does not match the "stop progress" buttons for the built-in Mac OS X applications:

  1. It's much darker than the buttons in Finder and Safari, and slightly darker than the one in iCal.
  2. It doesn't change color on rollover/hover like the buttons in Finder, Safari, and iCal.

Is there an NSButton setting I'm missing that would make the system-provided image look "right"?

Failing that, is it better to use NSImageNameStopProgressFreestandingTemplate and look "wrong," or to write a button subclass and bundle some TIFFs, which is what most applications (including Apple's) seem to be doing?

+1  A: 

The docs on [NSImage setTemplate:] suggest varying the alpha to determine how dark it is. However, I'm not sure how to do that when you're not directly drawing the image. I don't see a better way than writing your own subclass of NSButton or maybe NSButtonCell.

JWWalker