I would like to provide some feedback when the mouse is over on one of the cells of an IKImageBrowserView
.
Specifically, I'd like to resize the cell a little, to make it appear slightly larger on mouse-over. Alternatively, highlighting the background/border would be fine.
Unfortunately, IKImageBrowserCell
is not a subclass of NSCell
, but rather NSObject
, and I can't find the solution in the APIs. Any ideas?
You could try subclassing IKImageBrowserView and adding an NSTrackingArea to the visible rect. You could then implement -mouseMoved: to work with the tracking area to locate the correct image cell using -indexOfItemAtPoint: then get its frame by using -itemFrameAtIndex:.
Rather than try to muck with IKImageBrowserView's black-box layers and drawing, you could add your own layer (or borderless window) above the newly-discovered frame and use standard animations to grow/shrink/animate/glow/shake/whatever this "cheat" cell. Let clicks "pass through" (and hide your "cheat" cell) so the normal drag-and-drop mechanism works the same. IKImageBrowserView has its own -setForegroundLayer: method that allows you to add an "overlay layer" - perfectly suited for this purpose, I'd imagine.
That'd be my first attempt at solving this problem if it were my own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With