收口 Makelore 客户端变更
This commit is contained in:
23
electron/main/window-material.ts
Normal file
23
electron/main/window-material.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { BrowserWindowConstructorOptions } from 'electron';
|
||||
|
||||
type NativeWindowMaterialOptions = Pick<
|
||||
BrowserWindowConstructorOptions,
|
||||
'backgroundColor' | 'transparent' | 'vibrancy' | 'visualEffectState'
|
||||
>;
|
||||
|
||||
/**
|
||||
* Use the native macOS material only where Electron and the window manager
|
||||
* support it. Other platforms keep the normal opaque window as a safe fallback.
|
||||
*/
|
||||
export function getNativeWindowMaterialOptions(
|
||||
platform: NodeJS.Platform,
|
||||
): NativeWindowMaterialOptions {
|
||||
if (platform !== 'darwin') return {};
|
||||
|
||||
return {
|
||||
backgroundColor: '#00000000',
|
||||
transparent: true,
|
||||
vibrancy: 'under-window',
|
||||
visualEffectState: 'active',
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user