开发者

How to create badge with image in sidebar (like in Mail.app)?

开发者 https://www.devze.com 2022-12-19 01:18 出处:网络
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).

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消