Skip to content

Commit

Permalink
🎨 #4567
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 5, 2023
1 parent c086426 commit 3c2ae56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 10 additions & 2 deletions app/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,16 @@ app.whenReady().then(() => {
ipcMain.on('siyuan-config-theme', (event, theme) => {
nativeTheme.themeSource = theme
})
ipcMain.on('siyuan-config-tray', (event, id) => {
BrowserWindow.fromId(id).hide()
ipcMain.on('siyuan-config-tray', (event, data) => {
workspaces.find(item => {
if (item.id === data.id) {
item.browserWindow.hide()
if ('win32' === process.platform || 'linux' === process.platform) {
resetTrayMenu(item.tray, data.languages, item.browserWindow)
}
return true
}
})
})
ipcMain.on('siyuan-export-pdf', (event, data) => {
BrowserWindow.fromId(data.id).webContents.send('siyuan-export-pdf', data)
Expand Down
5 changes: 4 additions & 1 deletion app/src/util/onGetConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@ const winOnClose = (currentWindow: Electron.BrowserWindow, close = false) => {
if (window.siyuan.config.appearance.closeButtonBehavior === 1 && !close) {
// 最小化
if ("windows" === window.siyuan.config.system.os) {
ipcRenderer.send(Constants.SIYUAN_CONFIG_TRAY, getCurrentWindow().id);
ipcRenderer.send(Constants.SIYUAN_CONFIG_TRAY, {
id: getCurrentWindow().id,
languages: window.siyuan.languages["_trayMenu"],
});
} else {
if (currentWindow.isFullScreen()) {
currentWindow.once("leave-full-screen", () => currentWindow.hide());
Expand Down

0 comments on commit 3c2ae56

Please sign in to comment.