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

index 7ac23cc..3907f10 100644 (file)
         [_disabledStrokeColor setStroke];
     }
 
+    [NSGraphicsContext saveGraphicsState];
+    if ([super showsFirstResponder] && [[[self controlView] window] isKeyWindow] &&
+       ([self focusRingType] == NSFocusRingTypeDefault ||
+        [self focusRingType] == NSFocusRingTypeExterior)) {
+        NSSetFocusRingStyle(NSFocusRingOnly);
+    }
     [backgroundPath setLineWidth:1.0];
     [backgroundPath stroke];
+    [NSGraphicsContext restoreGraphicsState];
 
     // Now drawing tick
     if ([self intValue]) {