mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
mac 上隐藏 dock 图标
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { app, BrowserWindow, Menu, Tray } from 'electron'
|
||||
import * as path from 'path'
|
||||
import * as os from 'os'
|
||||
import { dialog } from 'electron'
|
||||
import * as yargs from 'yargs'
|
||||
import server from './server/main'
|
||||
@@ -8,6 +9,8 @@ import * as updater from './updater'
|
||||
import { getAccelerator, registerShortcut } from './shortcut'
|
||||
const opn = require('opn')
|
||||
|
||||
const isMacos = os.platform() === 'darwin'
|
||||
|
||||
let isDev = false
|
||||
|
||||
const showTray = !(yargs.argv['disable-tray'])
|
||||
@@ -105,6 +108,8 @@ const createWindow = () => {
|
||||
const showWindow = () => {
|
||||
if (win) {
|
||||
const show = () => {
|
||||
// macos 上隐藏图标
|
||||
isMacos && app.dock.hide()
|
||||
win.setSkipTaskbar(false)
|
||||
win.show()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user