Skip to content

Commit

Permalink
fix: 🐛 修复 macOS 最小化到托盘后状态栏图标不显示的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Oct 24, 2023
1 parent 18d490f commit a789826
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 16 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%;">
Expand Down
2 changes: 1 addition & 1 deletion electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
8 changes: 5 additions & 3 deletions electron/configs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 2 additions & 4 deletions electron/events/tray/index.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down Expand Up @@ -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')

Expand Down
Binary file removed electron/resources/extra/tray-Template.bak.png
Binary file not shown.
Binary file removed electron/resources/extra/tray-Template.png
Binary file not shown.
Binary file added electron/resources/extra/trayTemplate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added electron/resources/extra/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added electron/resources/extra/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed src/assets/logo.png
Binary file not shown.
27 changes: 22 additions & 5 deletions src/components/About/index.vue
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default params =>
resolve: {
alias: {
'@': resolve('src'),
'@electron': resolve('electron'),
},
},
plugins: [
Expand Down

0 comments on commit a789826

Please sign in to comment.