[vlc-commits] macOS: Draw focus ring for VLCHUDCheckboxCell

Marvin Scholz git at videolan.org
Wed Jun 21 00:35:43 CEST 2017


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed Jun 21 00:20:40 2017 +0200| [32cdb7aadd99f72f05e2cbe2d53d0b4a93dba2a6] | committer: Marvin Scholz

macOS: Draw focus ring for VLCHUDCheckboxCell

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=32cdb7aadd99f72f05e2cbe2d53d0b4a93dba2a6
---

 modules/gui/macosx/VLCHUDCheckboxCell.m | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/gui/macosx/VLCHUDCheckboxCell.m b/modules/gui/macosx/VLCHUDCheckboxCell.m
index 7ac23cc0cf..3907f10590 100644
--- a/modules/gui/macosx/VLCHUDCheckboxCell.m
+++ b/modules/gui/macosx/VLCHUDCheckboxCell.m
@@ -92,8 +92,15 @@
         [_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]) {



More information about the vlc-commits mailing list