Fix electron downgrade
This commit is contained in:
@@ -74,7 +74,7 @@ const editMenu: MenuItemConstructorOptions = {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
const viewMenu = {
|
const viewMenu: MenuItemConstructorOptions = {
|
||||||
label: 'View',
|
label: 'View',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
@@ -93,8 +93,9 @@ const viewMenu = {
|
|||||||
click: () => {
|
click: () => {
|
||||||
const window = BrowserWindow.getFocusedWindow()
|
const window = BrowserWindow.getFocusedWindow()
|
||||||
if (window) {
|
if (window) {
|
||||||
const zoom = window.webContents.getZoomFactor()
|
window.webContents.getZoomFactor((zoom) => {
|
||||||
window.webContents.setZoomFactor(Math.min(zoom + 0.1, 2.0))
|
window.webContents.setZoomFactor(Math.min(zoom + 0.1, 2.0))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -104,15 +105,16 @@ const viewMenu = {
|
|||||||
click: () => {
|
click: () => {
|
||||||
const window = BrowserWindow.getFocusedWindow()
|
const window = BrowserWindow.getFocusedWindow()
|
||||||
if (window) {
|
if (window) {
|
||||||
const zoom = window.webContents.getZoomFactor()
|
window.webContents.getZoomFactor((zoom) => {
|
||||||
window.webContents.setZoomFactor(Math.max(zoom - 0.1, 0.5))
|
window.webContents.setZoomFactor(Math.max(zoom - 0.1, 0.5))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
const template: Array<(MenuItemConstructorOptions) | (MenuItem)> = [
|
const template: any = [
|
||||||
applicationMenu,
|
applicationMenu,
|
||||||
editMenu,
|
editMenu,
|
||||||
viewMenu,
|
viewMenu,
|
||||||
|
|||||||
Reference in New Issue
Block a user