macosx: Correct VLCHUDRadiobuttonCell state colors
authorMarvin Scholz <epirat07@gmail.com>
Sun, 5 Jun 2016 09:28:27 +0000 (11:28 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 5 Jun 2016 09:56:21 +0000 (11:56 +0200)
Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
modules/gui/macosx/VLCHUDRadiobuttonCell.m

index 68290bf..912735e 100644 (file)
     }
 }
 
+- (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