Browse Source

macosx: restore compilation compatibility with SDK versions < 10.14

pull/72/head
Felix Paul Kühne 8 years ago
parent
commit
e3ea13c07c
  1. 10
      modules/gui/macosx/CompatibilityFixes.h
  2. 6
      modules/gui/macosx/CompatibilityFixes.m
  3. 7
      modules/gui/macosx/VLCBottomBarView.m
  4. 1
      modules/gui/macosx/VLCSlider.m
  5. 2
      modules/gui/macosx/VLCSliderCell.m
  6. 2
      modules/gui/macosx/VLCVolumeSlider.m
  7. 2
      modules/gui/macosx/VLCVolumeSliderCell.m

10
modules/gui/macosx/CompatibilityFixes.h

@ -24,5 +24,15 @@
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
#pragma mark -
void swapoutOverride(Class _Nonnull cls, SEL _Nonnull selector);
#ifndef MAC_OS_X_VERSION_10_14
extern NSString *const NSAppearanceNameDarkAqua;
#endif
NS_ASSUME_NONNULL_END

6
modules/gui/macosx/CompatibilityFixes.m

@ -43,3 +43,9 @@ void swapoutOverride(Class cls, SEL selector)
if (subclassMeth && baseImp)
method_setImplementation(subclassMeth, baseImp);
}
#ifndef MAC_OS_X_VERSION_10_14
NSString *const NSAppearanceNameDarkAqua = @"NSAppearanceNameDarkAqua";
#endif

7
modules/gui/macosx/VLCBottomBarView.m

@ -74,19 +74,16 @@
endingColor:[NSColor colorWithSRGBRed:0.82 green:0.82 blue:0.82 alpha:1.0]];
_lightStroke = [NSColor colorWithSRGBRed:0.65 green:0.65 blue:0.65 alpha:1.0];
if (OSX_MOJAVE_AND_HIGHER) {
if (@available(macOS 10.14, *)) {
_darkGradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithSRGBRed:0.27 green:0.27 blue:0.27 alpha:1.0]
endingColor:[NSColor colorWithSRGBRed:0.22 green:0.22 blue:0.22 alpha:1.0]];
_darkStroke = [NSColor colorWithSRGBRed:0.17 green:0.17 blue:0.18 alpha:1.0];
[self viewDidChangeEffectiveAppearance];
} else {
_darkGradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithSRGBRed:0.24 green:0.24 blue:0.24 alpha:1.0]
endingColor:[NSColor colorWithSRGBRed:0.07 green:0.07 blue:0.07 alpha:1.0]];
_darkStroke = [NSColor blackColor];
}
if (@available(macOS 10.14, *)) {
[self viewDidChangeEffectiveAppearance];
}
}
- (void)calculatePaths

1
modules/gui/macosx/VLCSlider.m

@ -23,6 +23,7 @@
#import "VLCSlider.h"
#import "VLCSliderCell.h"
#import "CompatibilityFixes.h"
@implementation VLCSlider

2
modules/gui/macosx/VLCSliderCell.m

@ -82,7 +82,7 @@
- (void)setSliderStyleDark
{
// Color Declarations
if (OSX_MOJAVE_AND_HIGHER) {
if (@available(macOS 10.14, *)) {
_gradientColor = [NSColor colorWithCalibratedRed: 0.20 green: 0.20 blue: 0.20 alpha: 1];
_knobFillColor = [NSColor colorWithCalibratedRed: 0.81 green: 0.81 blue: 0.81 alpha: 1];
_activeKnobFillColor = [NSColor colorWithCalibratedRed: 0.76 green: 0.76 blue: 0.76 alpha: 1];

2
modules/gui/macosx/VLCVolumeSlider.m

@ -21,9 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import "VLCVolumeSlider.h"
#import "VLCVolumeSliderCell.h"
#import "CompatibilityFixes.h"
@implementation VLCVolumeSlider

2
modules/gui/macosx/VLCVolumeSliderCell.m

@ -89,7 +89,7 @@
- (void)setSliderStyleDark
{
// Color Declarations
if (OSX_MOJAVE_AND_HIGHER) {
if (@available(macOS 10.14, *)) {
_gradientColor = [NSColor colorWithCalibratedRed: 0.20 green: 0.20 blue: 0.20 alpha: 1];
_knobFillColor = [NSColor colorWithCalibratedRed: 0.81 green: 0.81 blue: 0.81 alpha: 1];
_activeKnobFillColor = [NSColor colorWithCalibratedRed: 0.76 green: 0.76 blue: 0.76 alpha: 1];

Loading…
Cancel
Save