From dcb3a133616a1be785419573c50f4f941d04ad38 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 14 Nov 2016 16:06:42 -0800 Subject: [PATCH] Use values directly since constants are 10.11+ --- atom/browser/native_window_mac.mm | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 9619f8ad84bc..42157f93f9d8 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -1212,7 +1212,7 @@ bool NativeWindowMac::IsVisibleOnAllWorkspaces() { } void NativeWindowMac::SetVibrancy(const std::string& type) { - if (!(base::mac::IsOSMavericks() || base::mac::IsOSYosemiteOrLater())) return; + if (!base::mac::IsOSYosemiteOrLater()) return; NSView* vibrant_view = [window_ vibrantView]; @@ -1251,19 +1251,27 @@ void NativeWindowMac::SetVibrancy(const std::string& type) { vibrancyType = NSVisualEffectMaterialTitlebar; } - if (base::mac::IsOSYosemiteOrLater()) { + if (base::mac::IsOSElCapitanOrLater()) { + // TODO(kevinsawicki): Use NSVisualEffectMaterial* constants directly once + // they are available in the minimum SDK version if (type == "selection") { - vibrancyType = NSVisualEffectMaterialSelection; + // NSVisualEffectMaterialSelection + vibrancyType = (NSVisualEffectMaterial) 4; } else if (type == "menu") { - vibrancyType = NSVisualEffectMaterialMenu; + // NSVisualEffectMaterialMenu + vibrancyType = (NSVisualEffectMaterial) 5; } else if (type == "popover") { - vibrancyType = NSVisualEffectMaterialPopover; + // NSVisualEffectMaterialPopover + vibrancyType = (NSVisualEffectMaterial) 6; } else if (type == "sidebar") { - vibrancyType = NSVisualEffectMaterialSidebar; + // NSVisualEffectMaterialSidebar + vibrancyType = (NSVisualEffectMaterial) 7; } else if (type == "medium-light") { - vibrancyType = NSVisualEffectMaterialMediumLight; + // NSVisualEffectMaterialMediumLight + vibrancyType = (NSVisualEffectMaterial) 8; } else if (type == "ultra-dark") { - vibrancyType = NSVisualEffectMaterialUltraDark; + // NSVisualEffectMaterialUltraDark + vibrancyType = (NSVisualEffectMaterial) 9; } }