[vlc-commits] macOS: Don't draw custom VLCHUDSegmentedCell on 10.10+

Marvin Scholz git at videolan.org
Thu Jun 15 20:30:13 CEST 2017


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Thu Jun 15 12:23:01 2017 +0200| [4308376aa4eabf0a73b32a084d894a13e99020f9] | committer: Marvin Scholz

macOS: Don't draw custom VLCHUDSegmentedCell on 10.10+

On 10.10 and higher the appearance the system uses for the
VLCHUDSegmentedCell is already adapted for HUD panels, no need
for this replacement.

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

 modules/gui/macosx/VLCHUDSegmentedCell.m | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/gui/macosx/VLCHUDSegmentedCell.m b/modules/gui/macosx/VLCHUDSegmentedCell.m
index 91db2848d2..cb4cc027df 100644
--- a/modules/gui/macosx/VLCHUDSegmentedCell.m
+++ b/modules/gui/macosx/VLCHUDSegmentedCell.m
@@ -33,6 +33,7 @@
 //	POSSIBILITY OF SUCH DAMAGE.
 
 #import "VLCHUDSegmentedCell.h"
+#import "CompatibilityFixes.h"
 
 @interface NSSegmentedCell (Private)
 
@@ -65,6 +66,10 @@
 
 - (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];
@@ -80,6 +85,10 @@
 
 - (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];



More information about the vlc-commits mailing list