refactor: remove mac-specific tray icons and standardize on generic icons (#30)

This commit is contained in:
ayangweb
2025-04-21 19:41:43 +08:00
committed by GitHub
parent cf4c295466
commit 9589da1488
4 changed files with 7 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,6 +1,6 @@
{
"identifier": "com.ayangweb.BongoCat",
"bundle": {
"resources": ["assets/tray-mac.png", "assets/logo.png"]
"resources": ["assets/tray.png", "assets/logo.png"]
}
}

View File

@@ -3,10 +3,11 @@ import type { Ref } from 'vue'
import { reactive, ref } from 'vue'
import { LISTEN_KEY } from '../constants'
import { useModelStore } from '../stores/model'
import { useTauriListen } from './useTauriListen'
import { useCatStore } from '@/stores/cat'
type MouseButtonValue = 'Left' | 'Right' | 'Middle'
interface MouseButtonEvent {
@@ -45,7 +46,7 @@ export function useDevice() {
const pressedMouses = ref<MouseButtonValue[]>([])
const mousePosition = reactive<MouseMoveValue>({ x: 0, y: 0 })
const pressedKeys = ref<string[]>([])
const modelStore = useModelStore()
const catStore = useCatStore()
const handlePress = <T>(array: Ref<T[]>, value?: T) => {
if (!value) return
@@ -62,7 +63,7 @@ export function useDevice() {
const normalizeKeyValue = (key: string) => {
key = key.replace(/(Left|Right|Gr)$/, '').replace(/F(\d+)/, 'Fn')
const isInvalidArrowKey = key.endsWith('Arrow') && modelStore.mode !== 'KEYBOARD'
const isInvalidArrowKey = key.endsWith('Arrow') && catStore.mode !== 'keyboard'
const isUnsupportedKey = !supportKeys.includes(key)
if (isInvalidArrowKey || isUnsupportedKey) return

View File

@@ -35,15 +35,14 @@ export function useTray() {
const menu = await getTrayMenu()
const iconPath = isMac ? 'assets/tray-mac.png' : 'assets/tray.png'
const icon = await resolveResource(iconPath)
const icon = await resolveResource('assets/tray.png')
const options: TrayIconOptions = {
menu,
icon,
id: TRAY_ID,
tooltip: `${appName} v${appVersion}`,
iconAsTemplate: true,
iconAsTemplate: false,
menuOnLeftClick: true,
}