macOS: Draw focus ring for VLCHUDRadiobuttonCell
authorMarvin Scholz <epirat07@gmail.com>
Tue, 20 Jun 2017 22:23:20 +0000 (00:23 +0200)
committerMarvin Scholz <epirat07@gmail.com>
Tue, 20 Jun 2017 22:25:41 +0000 (00:25 +0200)
modules/gui/macosx/VLCHUDRadiobuttonCell.m

index 33e1e37..5519fbe 100644 (file)
 
     // Draw border and background
     [NSColor.whiteColor setStroke];
+
+    [NSGraphicsContext saveGraphicsState];
+    if ([super showsFirstResponder] && [[[self controlView] window] isKeyWindow] &&
+        ([self focusRingType] == NSFocusRingTypeDefault ||
+         [self focusRingType] == NSFocusRingTypeExterior)) {
+        NSSetFocusRingStyle(NSFocusRingOnly);
+    }
     [backgroundPath setLineWidth:1.5];
     [backgroundPath stroke];
+    [NSGraphicsContext restoreGraphicsState];
 
     if ([self isEnabled]) {
         if ([self isHighlighted]) {