mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
feat: 完成windows与linux下的Titlebar (#1482)
* feat: 完成windows与linux下的Titlebar * update * fix: win titlebar * 优化部分api命名 * 视觉效果更好的标题间距 * fix: Linux title没有居中 * update * fix: Main style * 向renderer公开IpcRenderer.on * update
This commit is contained in:
parent
24798a0bf3
commit
1444bbefa2
11 changed files with 147 additions and 19 deletions
|
|
@ -1,8 +1,17 @@
|
|||
const { contextBridge, ipcRenderer } = require('electron')
|
||||
|
||||
contextBridge.exposeInMainWorld('ipcRenderer', ipcRenderer)
|
||||
contextBridge.exposeInMainWorld('ipcRenderer', {
|
||||
sendSync: ipcRenderer.sendSync,
|
||||
send: ipcRenderer.send,
|
||||
on: (channel, listener) => {
|
||||
ipcRenderer.on(channel, listener)
|
||||
return () => ipcRenderer.removeListener(channel, listener)
|
||||
},
|
||||
})
|
||||
contextBridge.exposeInMainWorld('env', {
|
||||
isElectron: true,
|
||||
isEnableTitlebar:
|
||||
process.platform === 'win32' || process.platform === 'linux',
|
||||
isLinux: process.platform === 'linux',
|
||||
isMac: process.platform === 'darwin',
|
||||
isWin: process.platform === 'win32',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue