alexrozanski / PXSourceList

Source List control for the Mac
Other
638 stars 76 forks source link

Availability to override the selection and the Group names color is missing #11

Closed kukosk closed 13 years ago

kukosk commented 13 years ago

I have written this piece of code to override the selection to a gradient. You should implement it.

You should use some #defines with the gradients and the roundness of the radius selection... :) And I also want to change the group names color somehow. A #define would be fine. I'm gona look into it now...

davedelong commented 13 years ago

Implementation details to satisfy a specific use-case (exact colors, behavior, etc) are best done in a custom subclass or your own fork of PXSourceList.

Perhaps instead you might consider adding a couple properties and updating your code to allow for more generic customization:

@property (nonatomic, retain) NSGradient *selectionGradient;
@property (nonatomic, retain) NSColor *groupHeadingTextColor;
alexrozanski commented 13 years ago

Hi kukosk, thanks for contributing.

However, I agree with Dave – the goal of PXSourceList is to provide a generic Source List control and interface but allow customization if needed – for example it still allows you to use custom cells (badge drawing isn't done in the cell, but rather in the Source List view to allow this) etc, which means it's very flexible, but inherently has a generic and relatively basic implementation to suit most developers' needs.

Selection drawing is also something that I intentionally left out because you get it all for free – drawing the selection gradient, drawing group rows and highlighting group rows with drag and drop is all done by AppKit, so it seemed unnecessary to reimplement it myself.

If you want something more tailored to your needs then you could simply subclass PXSourceList and implement this; and if you want to share this, fork the repository and add it to your own branch :)