fix: 🐛 修复 macOS 最小化到托盘后状态栏图标不显示的问题

This commit is contained in:
viarotel 2023-10-24 11:08:27 +08:00
parent 18d490f371
commit a78982673f
16 changed files with 37 additions and 16 deletions

View File

@ -63,7 +63,10 @@ jobs:
dist-release/*.deb
dist-release/*.rpm
dist-release/*.tar.gz
dist-release/*.yml
dist-release/*.blockmap
dist-release/latest.yml
dist-release/latest-mac.yml
dist-release/latest-linux.yml
dist-release/latest-linux-arm64.yml
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

View File

@ -4,7 +4,7 @@
# Escrcpy
📱 使用图形界面的 Scrcpy 显示和控制您的 Android 设备,由 Electron 驱动。 [查看更多截图](https://github.com/viarotel-org/escrcpy/tree/main/public/screenshot)
📱 使用图形界面的 Scrcpy 显示和控制您的 Android 设备,由 Electron 驱动。 [查看更多截图](https://github.com/viarotel-org/escrcpy/tree/main/screenshots)
<div style="display:flex;">
<img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/da63c9db7a944899b0ad27a0b67d29ae~tplv-k3u1fbpfcp-jj-mark:0:0:0:0:q75.image" alt="viarotel-escrcpy" style="width: 100%;">

View File

@ -59,7 +59,7 @@
"to": "extra",
"filter": ["**/*", "!core"]
},
"entitlementsInherit": "electron/resources/build/entitlements.mac.plist",
"entitlementsInherit": "entitlements.mac.plist",
"extendInfo": {
"NSDocumentsFolderUsageDescription": "Application requests access to the user's Documents folder.",
"NSDownloadsFolderUsageDescription": "Application requests access to the user's Downloads folder."

View File

@ -7,12 +7,14 @@ export const desktopPath = process.env.DESKTOP_PATH
export const devPublishPath = resolve('dev-publish.yml')
export const logoPath = buildResolve('logo@256x256.png')
export const logoPath = buildResolve('logo.png')
export const icoLogoPath = buildResolve('logo.ico')
export const icnsLogoPath = buildResolve('logo.icns')
export const trayPath = extraResolve('tray.png')
export const macTrayPath = extraResolve('tray-Template.png')
export const trayPath
= process.platform === 'darwin'
? extraResolve('trayTemplate.png')
: extraResolve('tray.png')
export const adbPath
= process.platform === 'win32'

View File

@ -1,5 +1,5 @@
import { Menu, Tray, app, dialog } from 'electron'
import { macTrayPath, trayPath } from '@electron/configs/index'
import { trayPath } from '@electron/configs/index.js'
import appStore from '@electron/helpers/store.js'
export default (mainWindow) => {
@ -29,9 +29,7 @@ export default (mainWindow) => {
else if (response === 1) {
mainWindow.hide()
const trayIcon = process.platform === 'darwin' ? macTrayPath : trayPath
tray = new Tray(trayIcon)
tray = new Tray(trayPath)
tray.setToolTip('escrcpy')

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

View File

@ -1,21 +1,38 @@
<template>
<div class="flex flex-col items-center justify-center h-full -mt-8">
<div class="">
<img src="@/assets/logo.png" class="h-48" alt="" />
<img src="@electron/resources/build/logo.png" class="h-48" alt="" />
</div>
<div class="pt-4 text-xl text-center italic text-gray-700">
📱 使用图形化的
<a class="hover:underline text-primary-500" :href="escrcpyURL" target="_blank">Scrcpy</a>
<a
class="hover:underline text-primary-500"
:href="escrcpyURL"
target="_blank"
>Scrcpy</a>
显示和控制您的 Android 设备 Electron 驱动
</div>
<div class="pt-12 pb-4">
<el-button :loading="loading" type="primary" size="large" @click="handleUpdate">
{{ loading && percent ? `正在更新中...${percent.toFixed(1)}%` : '版本检测更新' }}
<el-button
:loading="loading"
type="primary"
size="large"
@click="handleUpdate"
>
{{
loading && percent
? `正在更新中...${percent.toFixed(1)}%`
: "版本检测更新"
}}
</el-button>
</div>
<div class="text-sm">
Supported by
<a class="hover:underline text-primary-500" href="https://viarotel.github.io/" target="_blank">Viarotel</a>
<a
class="hover:underline text-primary-500"
href="https://viarotel.github.io/"
target="_blank"
>Viarotel</a>
v{{ version }}
</div>
</div>

View File

@ -31,6 +31,7 @@ export default params =>
resolve: {
alias: {
'@': resolve('src'),
'@electron': resolve('electron'),
},
},
plugins: [