| 72 | } |
| 73 | |
| 74 | function applyWindowEffectMac(name: EffectName, options) { |
| 75 | if (name === 'vibrancy') { |
| 76 | const material = String(options.material) |
| 77 | const alwaysOn = Boolean(options.alwaysOn) |
| 78 | if (material in NSVisualEffectMaterial) { |
| 79 | const state = alwaysOn ? 1 : 0 |
| 80 | native.SetWindowVibrancy(NSVisualEffectMaterial[material], state) |
| 81 | } else { |
| 82 | console.warn('Unsupported vibrancy material: %s', material) |
| 83 | } |
| 84 | } |
| 85 | else if (name in WinToMacMaterial) { |
| 86 | native.SetWindowVibrancy(WinToMacMaterial[name], 0) |
| 87 | } else { |
| 88 | console.warn('Unknown window visual effect: %s', name) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | function applyWindowEffectWin(name: EffectName, options) { |
| 93 | if (name in WinBackdropType) { |