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

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


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

macOS: Draw focus ring for VLCHUDRadiobuttonCell

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

 modules/gui/macosx/VLCHUDRadiobuttonCell.m | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/gui/macosx/VLCHUDRadiobuttonCell.m b/modules/gui/macosx/VLCHUDRadiobuttonCell.m
index 33e1e3715a..5519fbeedf 100644
--- a/modules/gui/macosx/VLCHUDRadiobuttonCell.m
+++ b/modules/gui/macosx/VLCHUDRadiobuttonCell.m
@@ -80,8 +80,16 @@
 
     // 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]) {



More information about the vlc-commits mailing list