add color icon & handling
This commit is contained in:
+5
-7
@@ -165,7 +165,9 @@ async function resolveTrayIconForTheme() {
|
||||
const existingTheme = usePersistedStore.getState().appearance
|
||||
console.log('[resolveTrayIconForTheme] existingTheme', existingTheme)
|
||||
|
||||
const isLinux = platform() === 'linux'
|
||||
if (existingTheme.tray === 'color') {
|
||||
return await resolveResource('icons/favicon/icon-color.png')
|
||||
}
|
||||
|
||||
if (existingTheme.tray === 'system') {
|
||||
if (platform() === 'macos') {
|
||||
@@ -178,9 +180,7 @@ async function resolveTrayIconForTheme() {
|
||||
console.log('[resolveTrayIconForTheme] windowTheme', windowTheme)
|
||||
|
||||
const pickedPath =
|
||||
windowTheme === 'dark'
|
||||
? `icons/favicon/icon${isLinux ? '-padded' : ''}.png`
|
||||
: `icons/favicon/icon-light${isLinux ? '-padded' : ''}.png`
|
||||
windowTheme === 'dark' ? 'icons/favicon/icon.png' : 'icons/favicon/icon-light.png'
|
||||
|
||||
return await resolveResource(pickedPath)
|
||||
} catch {
|
||||
@@ -194,9 +194,7 @@ async function resolveTrayIconForTheme() {
|
||||
}
|
||||
|
||||
const pickedPath =
|
||||
existingTheme.tray === 'dark'
|
||||
? `icons/favicon/icon-light${isLinux ? '-padded' : ''}.png`
|
||||
: `icons/favicon/icon${isLinux ? '-padded' : ''}.png`
|
||||
existingTheme.tray === 'dark' ? 'icons/favicon/icon-light.png' : 'icons/favicon/icon.png'
|
||||
|
||||
return await resolveResource(pickedPath)
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -234,7 +234,7 @@ export default function GeneralSection() {
|
||||
label="Tray Theme"
|
||||
selectedKeys={[appearance.tray]}
|
||||
onSelectionChange={(keys) => {
|
||||
const value = Array.from(keys)[0] as 'light' | 'dark' | 'system'
|
||||
const value = Array.from(keys)[0] as 'light' | 'dark' | 'system' | 'color'
|
||||
usePersistedStore.setState((state) => ({
|
||||
appearance: { ...state.appearance, tray: value },
|
||||
}))
|
||||
@@ -249,6 +249,7 @@ export default function GeneralSection() {
|
||||
<SelectItem key="system">System</SelectItem>
|
||||
<SelectItem key="light">Light</SelectItem>
|
||||
<SelectItem key="dark">Dark</SelectItem>
|
||||
<SelectItem key="color">Color</SelectItem>
|
||||
</Select>
|
||||
)}
|
||||
</div>
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
import { ask } from '@tauri-apps/plugin-dialog'
|
||||
import { platform } from '@tauri-apps/plugin-os'
|
||||
import { exit } from '@tauri-apps/plugin-process'
|
||||
import { LazyStore } from '@tauri-apps/plugin-store'
|
||||
import { create } from 'zustand'
|
||||
@@ -134,7 +135,7 @@ interface PersistedStateV2 {
|
||||
acknowledgements: string[]
|
||||
|
||||
appearance: {
|
||||
tray: 'light' | 'dark' | 'system'
|
||||
tray: 'light' | 'dark' | 'system' | 'color'
|
||||
app: 'light' | 'dark' | 'system'
|
||||
}
|
||||
}
|
||||
@@ -212,7 +213,7 @@ export const usePersistedStore = create<PersistedStateV2>()(
|
||||
acknowledgements: [],
|
||||
|
||||
appearance: {
|
||||
tray: 'system',
|
||||
tray: platform() === 'linux' ? 'color' : 'system',
|
||||
app: 'dark',
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user