mirror of
https://github.com/ayangweb/BongoCat.git
synced 2026-03-12 17:51:48 +08:00
refactor: remove mac-specific tray icons and standardize on generic icons (#30)
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"identifier": "com.ayangweb.BongoCat",
|
||||
"bundle": {
|
||||
"resources": ["assets/tray-mac.png", "assets/logo.png"]
|
||||
"resources": ["assets/tray.png", "assets/logo.png"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user