Figured I may as well fire up a pull request so you can grab the changes we've made at Karelia at some point if suits you.
tweaks to dock progress indicator
use applicationIconImage instead of NSApplicationIcon
Several code changes (and nib fixes) to allow *most* alerts to show w…
…hatever the current NSApp applicationIconImage. Still we are missing several cases -- more custom alert nibs, plus calls to Begin.*Alert that don't give us a way to change the app icon.
Trying to make dock icon, when re-set, scale properly in UI scaling. …
…Hmm, not quite it though...
clean up shared graphics. I've added NSCaution since that is 10.6 only
ALWAYS copy images when planning to modify them. Especially if they t…
…urn out to be lazily generated in some way behind the scenes.
new improved dock progress indicator though you won't see it until we…
… get the app fixed
stop a warning
Use non-deprecated drawing API.
#198703 Draw progress indicator into a 256 pixel version of app icon.
I don't understand why we have this code:
Mike -- Point 1, yes, that's true. But the problem is that it returns a 128 pixel image! So if we want a 256 image version, we need to somehow get at the source file and get an NSImage from that.
Point 2 -- I found that because the image's first representation is 128 pixels, that if I did the composting without explicitly saying I wanted the image to be 256 pixels, it would use the 128 pixel representation, and of course that didn't match well. Also, sApplicationIconImage is not shared with other parts of the application.
If you don't believe me, try this yourself. I wouldn't have written this code if I didn't need to :-)
In my quick test, [NSImage imageNamed:NSImageNameApplicationIcon] gives a 128x128 image, containing representations for all different sizes we might be interested in. My understanding is that drawing the image at 256px will pick the 256px representation, but I might well be wrong. Even so, we could ask the appropriate rep to draw itself directly, rather than asking the image itself.
-[NSApplication applicationIconImage] on the other hand, I found returns a 128x128 image containing a single CGImage-based rep.
Yes, the sApplicationIconImage variable isn't shared, but we're plucking the image out of the +imageNamed: cache, where it might be in use by another bit of the app, either now or in future. As ever, as a general rule, don't mutate an image unless you've just created it.
ok, fixed. I copied the image (rather than retained it) so I could adjust its size, which was necessary.
Use imageNamed:NSImageNameApplicationIcon as generic name for app ico…
…n. Copy image so that we can modify its size without any other potential clients being messed up.
This is definitely an improvement over my busted old code :-) That said, shouldn't it be 512 px these days?
Merge pull request #4 from karelia/master
Accept Karelia changes to UKDockProgressIndicator.
Yeah, think you're right at 512px. Of course it really ought to do the right thing for retina screens too!