MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / applyWindowEffectMac

Function applyWindowEffectMac

plugins/src/preload/api/Effect.ts:74–90  ·  view source on GitHub ↗
(name: EffectName, options)

Source from the content-addressed store, hash-verified

72}
73
74function 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
92function applyWindowEffectWin(name: EffectName, options) {
93 if (name in WinBackdropType) {

Callers 1

applyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected