macOS: Don't draw custom VLCHUDSegmentedCell on 10.10+
authorMarvin Scholz <epirat07@gmail.com>
Thu, 15 Jun 2017 10:23:01 +0000 (12:23 +0200)
committerMarvin Scholz <epirat07@gmail.com>
Thu, 15 Jun 2017 18:29:42 +0000 (20:29 +0200)
On 10.10 and higher the appearance the system uses for the
VLCHUDSegmentedCell is already adapted for HUD panels, no need
for this replacement.

modules/gui/macosx/VLCHUDSegmentedCell.m

index 91db284..cb4cc02 100644 (file)
@@ -33,6 +33,7 @@
 //     POSSIBILITY OF SUCH DAMAGE.
 
 #import "VLCHUDSegmentedCell.h"
+#import "CompatibilityFixes.h"
 
 @interface NSSegmentedCell (Private)
 
 
 - (void)drawWithFrame:(NSRect)frame inView:(NSView *)view
 {
+    if (OSX_YOSEMITE_AND_HIGHER) {
+        return [super drawWithFrame:frame inView:view];
+    }
+
     for (NSInteger segment = 0; segment < self.segmentCount; segment++) {
         NSRect segmentRect = [self rectForSegment:segment inFrame:frame];
         [self drawBackgroundForSegment:segment inFrame:segmentRect];
 
 - (void)drawSegment:(NSInteger)segment inFrame:(NSRect)frame withView:(NSView *)view
 {
+    if (OSX_YOSEMITE_AND_HIGHER) {
+        return [super drawSegment:segment inFrame:frame withView:view];
+    }
+
     NSString *segmentText = [self labelForSegment:segment];
 
     NSSize textSize = [segmentText sizeWithAttributes:nil];