[vlc-commits] macosx: Correct VLCHUDRadiobuttonCell state colors

Marvin Scholz git at videolan.org
Sun Jun 5 11:56:13 CEST 2016


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sun Jun  5 11:28:27 2016 +0200| [5f4b00e0432e65e7409ea38f2280d891c3bf423c] | committer: Felix Paul Kühne

macosx: Correct VLCHUDRadiobuttonCell state colors

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

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

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

diff --git a/modules/gui/macosx/VLCHUDRadiobuttonCell.m b/modules/gui/macosx/VLCHUDRadiobuttonCell.m
index 68290bf..912735e 100644
--- a/modules/gui/macosx/VLCHUDRadiobuttonCell.m
+++ b/modules/gui/macosx/VLCHUDRadiobuttonCell.m
@@ -92,4 +92,21 @@
     }
 }
 
+- (NSRect)drawTitle:(NSAttributedString *)title withFrame:(NSRect)frame inView:(NSView *)controlView
+{
+    NSMutableAttributedString *coloredTitle = [[NSMutableAttributedString alloc]
+                                               initWithAttributedString:title];
+    if (self.isEnabled) {
+        [coloredTitle addAttribute:NSForegroundColorAttributeName
+                             value:[NSColor whiteColor]
+                             range:NSMakeRange(0, coloredTitle.length)];
+    } else {
+        [coloredTitle addAttribute:NSForegroundColorAttributeName
+                             value:[NSColor grayColor]
+                             range:NSMakeRange(0, coloredTitle.length)];
+    }
+
+    return [super drawTitle:coloredTitle withFrame:frame inView:controlView];
+}
+
 @end



More information about the vlc-commits mailing list