How to create badge with image in sidebar (like in Mail.app)?
I'm creat开发者_开发百科ing NSOutlineView
with custom cell class (extending NSTextFieldCell
) which should display image-based badge (something like in Mail.app while working offline).
Is this approach appropriate? I've created NSRect with oval shape inside (with bezierPathWithRoundedRect:xRadius:yRadius
: method) which is filled with color depending if window is active etc. I've prepared a image with a symbol I want to dispay (grey on transparent background) and draw it inside a rect using drawInRect:fromRect:operation:fraction:
method. I'm able to choose such a NSCompositingOperation
to have an image displayed properly when background is blue or grey but not on white background.
May it be related to the brightness of the image is (or is it another image-related problem) or maybe should I do something totally different?
精彩评论