macOS: Remove broken VLCHUDTableHeaderCell
authorMarvin Scholz <epirat07@gmail.com>
Sat, 24 Jun 2017 09:49:41 +0000 (11:49 +0200)
committerMarvin Scholz <epirat07@gmail.com>
Sat, 24 Jun 2017 09:50:09 +0000 (11:50 +0200)
It does not draw correctly neither on 10.7 nor on 10.10 and I found
no way to fix it, so far, therefore remove it for now, as it is just a
minor detail. It looks good with the system drawing on 10.10+ and looks
ok on 10.7.

extras/package/macosx/VLC.xcodeproj/project.pbxproj
modules/gui/macosx/Makefile.am
modules/gui/macosx/VLCHUDOutlineView.m
modules/gui/macosx/VLCHUDTableHeaderCell.h [deleted file]
modules/gui/macosx/VLCHUDTableHeaderCell.m [deleted file]

index 02acaf6..0518a80 100644 (file)
@@ -82,7 +82,6 @@
                6B81662C1EBFC38100C26F1B /* VLCUIWidgets.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CCED71514C0D4A90057F8D1 /* VLCUIWidgets.m */; };
                6B9FD0391EEB5D8A0085151F /* VLCHUDScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B9FD0381EEB5D8A0085151F /* VLCHUDScroller.m */; };
                6BBB05DA1EEFEA29003A1019 /* VLCHUDOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBB05D91EEFEA29003A1019 /* VLCHUDOutlineView.m */; };
-               6BBB05DD1EEFEADF003A1019 /* VLCHUDTableHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBB05DC1EEFEADF003A1019 /* VLCHUDTableHeaderCell.m */; };
                6BBB05E01EEFF165003A1019 /* VLCHUDTableCornerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBB05DF1EEFF165003A1019 /* VLCHUDTableCornerView.m */; };
                6BBB05E31EF08181003A1019 /* VLCHUDSegmentedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BBB05E21EF08181003A1019 /* VLCHUDSegmentedCell.m */; };
                6BF093F91EE0182B0049D8B0 /* VLCTimeField.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF093F81EE0182B0049D8B0 /* VLCTimeField.m */; };
                6B9FD0381EEB5D8A0085151F /* VLCHUDScroller.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCHUDScroller.m; sourceTree = "<group>"; };
                6BBB05D81EEFEA29003A1019 /* VLCHUDOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCHUDOutlineView.h; sourceTree = "<group>"; };
                6BBB05D91EEFEA29003A1019 /* VLCHUDOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCHUDOutlineView.m; sourceTree = "<group>"; };
-               6BBB05DB1EEFEADF003A1019 /* VLCHUDTableHeaderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCHUDTableHeaderCell.h; sourceTree = "<group>"; };
-               6BBB05DC1EEFEADF003A1019 /* VLCHUDTableHeaderCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCHUDTableHeaderCell.m; sourceTree = "<group>"; };
                6BBB05DE1EEFF165003A1019 /* VLCHUDTableCornerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCHUDTableCornerView.h; sourceTree = "<group>"; };
                6BBB05DF1EEFF165003A1019 /* VLCHUDTableCornerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCHUDTableCornerView.m; sourceTree = "<group>"; };
                6BBB05E11EF08181003A1019 /* VLCHUDSegmentedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCHUDSegmentedCell.h; sourceTree = "<group>"; };
                                6BBB05D91EEFEA29003A1019 /* VLCHUDOutlineView.m */,
                                6BBB05DE1EEFF165003A1019 /* VLCHUDTableCornerView.h */,
                                6BBB05DF1EEFF165003A1019 /* VLCHUDTableCornerView.m */,
-                               6BBB05DB1EEFEADF003A1019 /* VLCHUDTableHeaderCell.h */,
-                               6BBB05DC1EEFEADF003A1019 /* VLCHUDTableHeaderCell.m */,
                                6BBB05E11EF08181003A1019 /* VLCHUDSegmentedCell.h */,
                                6BBB05E21EF08181003A1019 /* VLCHUDSegmentedCell.m */,
                        );
                                6B8166291EBFC34300C26F1B /* VLCDefaultValueSlider.m in Sources */,
                                6B81662A1EBFC34300C26F1B /* VLCDefaultValueSliderCell.m in Sources */,
                                1C69FDF61EAB30C7007724ED /* Windows.m in Sources */,
-                               6BBB05DD1EEFEADF003A1019 /* VLCHUDTableHeaderCell.m in Sources */,
                                6B3BE42C1E6217CB008D098A /* VLCImageButton.m in Sources */,
                                6B4D50901E79781F004479B5 /* VLCHotkeyChangeWindow.m in Sources */,
                                1C3114031E508C8800D4DD76 /* AppleRemote.m in Sources */,
index aa063a0..9e7a2ab 100644 (file)
@@ -80,7 +80,6 @@ libmacosx_plugin_la_SOURCES = \
        gui/macosx/VLCHUDOutlineView.h gui/macosx/VLCHUDOutlineView.m \
        gui/macosx/VLCHUDTableView.h gui/macosx/VLCHUDTableView.m \
        gui/macosx/VLCHUDTableCornerView.h gui/macosx/VLCHUDTableCornerView.m \
-       gui/macosx/VLCHUDTableHeaderCell.h gui/macosx/VLCHUDTableHeaderCell.m \
        gui/macosx/VLCHUDSegmentedCell.h gui/macosx/VLCHUDSegmentedCell.m \
        gui/macosx/VLCHUDStepperCell.h gui/macosx/VLCHUDStepperCell.m \
        gui/macosx/VLCHUDPopUpButtonCell.h gui/macosx/VLCHUDPopUpButtonCell.m \
index 447b67e..b0a6bf2 100644 (file)
@@ -33,7 +33,6 @@
 //     POSSIBILITY OF SUCH DAMAGE.
 
 #import "VLCHUDOutlineView.h"
-#import "VLCHUDTableHeaderCell.h"
 #import "VLCHUDTableCornerView.h"
 
 @interface NSOutlineView (private)
 
         [self setBackgroundColor:_tableBackgroundColor];
         [self setFocusRingType:NSFocusRingTypeNone];
-
-        // Setup Header Cells
-        for (NSTableColumn* aColumn in [self tableColumns]) {
-
-            // Create new cell and set it's props to that of old cell
-            VLCHUDTableHeaderCell *newHeader = [[VLCHUDTableHeaderCell alloc] init];
-            [newHeader setStringValue: [[aColumn headerCell] stringValue]];
-            [newHeader setFont: [[aColumn headerCell] font]];
-
-            [aColumn setHeaderCell: newHeader];
-        }
     }
 
     return self;
diff --git a/modules/gui/macosx/VLCHUDTableHeaderCell.h b/modules/gui/macosx/VLCHUDTableHeaderCell.h
deleted file mode 100644 (file)
index 36a2165..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-//  VLCHUDTableHeaderCell.h
-//  BGHUDAppKit
-//
-//  Created by BinaryGod on 6/17/08.
-//
-//  Copyright (c) 2008, Tim Davis (BinaryMethod.com, binary.god@gmail.com)
-//  All rights reserved.
-//
-//  Redistribution and use in source and binary forms, with or without modification,
-//  are permitted provided that the following conditions are met:
-//
-//             Redistributions of source code must retain the above copyright notice, this
-//     list of conditions and the following disclaimer.
-//
-//             Redistributions in binary form must reproduce the above copyright notice,
-//     this list of conditions and the following disclaimer in the documentation and/or
-//     other materials provided with the distribution.
-//
-//             Neither the name of the BinaryMethod.com nor the names of its contributors
-//     may be used to endorse or promote products derived from this software without
-//     specific prior written permission.
-//
-//     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND
-//     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-//     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-//     IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-//     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//     BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-//     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-//     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-//     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//     POSSIBILITY OF SUCH DAMAGE.
-
-#import <Cocoa/Cocoa.h>
-
-@interface VLCHUDTableHeaderCell : NSTableHeaderCell
-
-@property (strong) NSColor *cellTextColor;
-@property (strong) NSColor *disabledCellTextColor;
-@property (strong) NSColor *tableHeaderCellBorderColor;
-@property (strong) NSGradient *tableHeaderCellNormalFill;
-@property (strong) NSGradient *tableHeaderCellSelectedFill;
-
-@end
diff --git a/modules/gui/macosx/VLCHUDTableHeaderCell.m b/modules/gui/macosx/VLCHUDTableHeaderCell.m
deleted file mode 100644 (file)
index 1161ef5..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-//
-//  VLCHUDTableHeaderCell.m
-//  BGHUDAppKit
-//
-//  Created by BinaryGod on 6/17/08.
-//
-//  Copyright (c) 2008, Tim Davis (BinaryMethod.com, binary.god@gmail.com)
-//  All rights reserved.
-//
-//  Redistribution and use in source and binary forms, with or without modification,
-//  are permitted provided that the following conditions are met:
-//
-//             Redistributions of source code must retain the above copyright notice, this
-//     list of conditions and the following disclaimer.
-//
-//             Redistributions in binary form must reproduce the above copyright notice,
-//     this list of conditions and the following disclaimer in the documentation and/or
-//     other materials provided with the distribution.
-//
-//             Neither the name of the BinaryMethod.com nor the names of its contributors
-//     may be used to endorse or promote products derived from this software without
-//     specific prior written permission.
-//
-//     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND
-//     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-//     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-//     IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-//     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//     BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-//     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-//     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-//     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//     POSSIBILITY OF SUCH DAMAGE.
-
-#import "VLCHUDTableHeaderCell.h"
-
-@interface NSTableHeaderCell (AppKitPrivate)
-- (void)_drawSortIndicatorIfNecessaryWithFrame:(NSRect)arg1 inView:(id)arg2;
-@end
-
-@implementation VLCHUDTableHeaderCell
-
-#pragma mark Drawing Functions
-
-- (instancetype)initWithCoder:(NSCoder *)coder
-{
-    self = [super initWithCoder:coder];
-    if (self) {
-        _cellTextColor = [NSColor whiteColor];
-        _disabledCellTextColor = [NSColor colorWithDeviceRed:1 green:1 blue:1 alpha:0.2f];
-        _tableHeaderCellBorderColor = [NSColor colorWithDeviceRed:0.349f green:0.361f blue:0.388f alpha:1.0f];
-        _tableHeaderCellNormalFill = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceRed:0.251f green:0.251f blue:0.255f alpha:1.0f]
-                                                                   endingColor:[NSColor colorWithDeviceRed:0.118f green:0.118f blue:0.118f alpha:1.0f]];
-        _tableHeaderCellSelectedFill = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceRed:0.651f green:0.651f blue:0.655f alpha:1.0f]
-                                                                     endingColor:[NSColor colorWithDeviceRed:0.518f green:0.518f blue:0.518f alpha:1.0f]];
-    }
-    return self;
-}
-
-- (id)textColor {
-
-    return _textColor;
-}
-
-- (void)_drawThemeContents:(NSRect)frame highlighted:(BOOL)flag inView:(id)view {
-
-    // Draw base layer
-    [_tableHeaderCellBorderColor set];
-    NSRectFill(frame);
-
-    // Adjust fill layer
-    // frame.origin.x += 1;    - Removed to fix Issue #31
-    frame.size.width -= 1;
-    frame.origin.y +=1;
-    frame.size.height -= 2;
-
-    if(flag) {
-        [_tableHeaderCellSelectedFill drawInRect: frame angle: 90];
-    } else {
-        [_tableHeaderCellNormalFill drawInRect: frame angle: 90];
-    }
-
-    // Adjust so text aligns correctly
-    frame.origin.x -= 1;
-    frame.size.width += 1;
-    frame.origin.y -= 1;
-    frame.size.height += 2;
-
-    // REMOVED - Enabling this line draws two sort arrows, frame alignment issue here.
-    //                  Not needed since the Apple drawing routines seem to be updating sort
-    //                  arrows fine.
-    /*if ([self respondsToSelector:@selector(_drawSortIndicatorIfNecessaryWithFrame:inView:)])
-     [super _drawSortIndicatorIfNecessaryWithFrame: frame inView: view];*/
-
-    frame.origin.y += (NSMidY(frame) - ([[self font] pointSize] /2)) - 2;
-    frame.origin.x += 3;
-
-
-
-    [super drawInteriorWithFrame: frame inView: view];
-}
-
-- (void)drawSortIndicatorWithFrame:(NSRect) frame inView:(id) controlView ascending:(BOOL) ascFlag priority:(NSInteger) priInt {
-
-    frame.origin.y -=1;
-    frame.size.height += 2;
-
-    if (priInt == 0) {
-
-        NSRect arrowRect = [self sortIndicatorRectForBounds: frame];
-
-        // Adjust Arrow rect
-        arrowRect.size.width -= 2;
-        arrowRect.size.height -= 1;
-
-        NSBezierPath *arrow = [[NSBezierPath alloc] init];
-        NSPoint points[3];
-
-        if (ascFlag == NO) {
-            // Re-center arrow
-            arrowRect.origin.y -= 2;
-            points[0] = NSMakePoint(NSMinX(arrowRect), NSMinY(arrowRect) +2);
-            points[1] = NSMakePoint(NSMaxX(arrowRect), NSMinY(arrowRect) +2);
-            points[2] = NSMakePoint(NSMidX(arrowRect), NSMaxY(arrowRect));
-        } else {
-            points[0] = NSMakePoint(NSMinX(arrowRect), NSMaxY(arrowRect) -2);
-            points[1] = NSMakePoint(NSMaxX(arrowRect), NSMaxY(arrowRect) -2);
-            points[2] = NSMakePoint(NSMidX(arrowRect), NSMinY(arrowRect));
-        }
-
-        [arrow appendBezierPathWithPoints: points count: 3];
-
-        if ([self isEnabled]) {
-            [_cellTextColor set];
-        } else {
-            [_disabledCellTextColor set];
-        }
-        
-        [arrow fill];
-    }
-    
-    frame.origin.y += 1;
-    frame.size.height -= 2;
-}
-
-@end