Animated "Heartbeat" Fuzzy Blue Box?


#1

I don’t know if this detail is newly unique to OS X Yosemite, as I honestly can’t recall such interface specifics from prior versions of the operating system. However, under Yosemite, the text fields still behave differently even after adding the fuzzy blue box code. Yes, the blue box looks correct now, in static form, but the text fields themselves have a transitional animation in which the fuzzy blue box zooms down or “heartbeats” around the view accepting firstResponder. It’s not something I would perhaps consciously notice normally, but when you tab back and forth – and as an newly obsessive compulsive programmer – the difference stands out. I have no idea if this is something quite complex or if it is just a matter of adding a couple more lines… but it would be nice to replicate!

:slight_smile:


#2

Ok, I’m responding to myself, but after a bit of searching on Stack Overflow I found the solution and it is super easy, so I thought I would re-post it here…

[code]- (void)drawRect:(NSRect)dirtyRect {
NSRect bounds = [self bounds];
[bgColor set];
[NSBezierPath fillRect:bounds];
}

  • (void)drawFocusRingMask {
    NSRectFill([self bounds]);
    }

  • (NSRect)focusRingMaskBounds {
    return [self bounds];
    }[/code]