tray icon light/dark, fixes #58

Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
FTCHD
2025-10-24 20:35:19 +02:00
parent 5eafbbfbdf
commit 4f065cca7a
+8 -2
View File
@@ -26,8 +26,14 @@ async function getTray() {
async function resolveTrayIconForTheme() {
let theme: 'light' | 'dark' = 'dark'
try {
const t = (await invoke<string>('get_system_theme')) || 'dark'
theme = t === 'dark' ? 'dark' : 'light'
if (platform() === 'macos') {
const t = (await invoke<string>('get_system_theme')) || 'dark'
theme = t === 'dark' ? 'dark' : 'light'
} else {
const currentWindow = getCurrentWindow()
const t = await currentWindow.theme()
theme = t === 'dark' ? 'dark' : 'light'
}
} catch {}
console.log('[resolveTrayIconForTheme] theme', theme)