Skip to content

Commit

Permalink
Update setup-titlebar.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
HazelNutHoney committed Feb 7, 2024
1 parent 6128f02 commit 26b7866
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/setup-titlebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ export default () => {
if (item) item.click(undefined, BrowserWindow.fromWebContents(event.sender), event.sender)
})

// Handle the minimum size.
ipcMain.on('window-set-minimumSize', (event, width, height) => {
const window = BrowserWindow.fromWebContents(event.sender);

/* eslint-disable indent */
if (window) {
window?.setMinimumSize(width, height);
}
});

// Handle menu item icon
ipcMain.on('menu-icon', (event, commandId: Number) => {
const item = getMenuItemByCommandId(commandId, Menu.getApplicationMenu())
Expand Down Expand Up @@ -77,4 +87,4 @@ function getMenuItemByCommandId(commandId: Number, menu: Electron.Menu | null):
}

return undefined
}
}

0 comments on commit 26b7866

Please sign in to comment.