quicksilver/Quicksilver — pull request #1378 by skurfer (2013-02-08 18:54:41+00:00)
Title: Retina support

This adds the `@2x` icons supplied by Dan so far and allows preview icons to be rendered at the maximum quality on retina displays, along with some other fixes.

Specifically

* There were a lot of places that used explicit `NSSize()` calls. I changed them to use the pre-defined `QSSizeXXX` values instead. Makes no difference really, but it could. Instead of doubling the size claimed by the interface controllers, we could instead just double all the QSSize definitions. So everywhere in the code that refers to QSSize128, it would actually get a 256x256 representation.
* The max icon size is supposed to be defined by the current interface, but it wasn't asking the interface for the max size on startup. Only if the interface was changed by the user. I fixed that, but I'm not sure if I went about it in the best way. b4bb1bc
* I *think* some of the references to 128x128 were made with the assumption that this was the max icon size, so I changed them to use the actual max icon size instead. d0af3ab

Things I didn't address, but we should talk about:

* It seems wasteful to call `createIconRepresentations` in some of the places we're using it. If I understand correctly, we usually only need to generate the size used by the QSObjectCell, and the size used in the results list (and their 2x counterparts) for the main interface. For prefs and things where the icons are smaller, it should be able to request the appropriate sizes as well instead of getting them all.
* Related to the above, since the sizes in `createIconRepresentations` are hard-coded, you could very well end up not generating the necessary sizes. For example, an interface might have a max icon size of 400x400 or something. So the "size used by the QSObjectCell" referenced above needs to be determined at runtime.

We can't just change `createIconRepresentations` because it's a category on `NSImage` and has no knowledge of the interface's current size requirements. But I'd hate for every place that currently calls it with a bunch of code to do the same thing. (There are some plug-ins that use it.) Perhaps we could create a method in the interface controller to generate icons instead of using the `NSImage` category.