diff --git a/src/renderer/src/env.d.ts b/src/renderer/src/env.d.ts index bd1c52d4..7c9ab3e7 100644 --- a/src/renderer/src/env.d.ts +++ b/src/renderer/src/env.d.ts @@ -14,6 +14,7 @@ interface ImportMeta { declare global { interface Window { + root: HTMLElement message: MessageInstance modal: HookAPI keyv: KeyvStorage diff --git a/src/renderer/src/hooks/useAppInit.ts b/src/renderer/src/hooks/useAppInit.ts index f830a07c..4b66d591 100644 --- a/src/renderer/src/hooks/useAppInit.ts +++ b/src/renderer/src/hooks/useAppInit.ts @@ -41,9 +41,7 @@ export function useAppInit() { useEffect(() => { const transparentWindow = windowStyle === 'transparent' && isMac && !minappShow - window.document.body.style.background = transparentWindow - ? 'var(--navbar-background-mac)' - : 'var(--navbar-background)' + window.root.style.background = transparentWindow ? 'var(--navbar-background-mac)' : 'var(--navbar-background)' }, [windowStyle, minappShow]) useEffect(() => { diff --git a/src/renderer/src/store/settings.ts b/src/renderer/src/store/settings.ts index 38080cf7..2b591f7c 100644 --- a/src/renderer/src/store/settings.ts +++ b/src/renderer/src/store/settings.ts @@ -32,7 +32,7 @@ const initialState: SettingsState = { messageFont: 'system', showInputEstimatedTokens: false, theme: ThemeMode.light, - windowStyle: 'opaque', + windowStyle: 'transparent', fontSize: 14, topicPosition: 'right', pasteLongTextAsFile: true,