feat: convert webContents primitives to properties (#18998)
* feat: convert webContents primitives to properties * address feedback from review
This commit is contained in:
parent
de072c6ef5
commit
8782d06ed6
9 changed files with 152 additions and 49 deletions
|
@ -679,7 +679,7 @@ const template = <Electron.MenuItemConstructorOptions[]> [
|
|||
accelerator: 'CmdOrCtrl+0',
|
||||
click: (item, focusedWindow) => {
|
||||
if (focusedWindow) {
|
||||
focusedWindow.webContents.setZoomLevel(0)
|
||||
focusedWindow.webContents.zoomLevel = 0
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -689,8 +689,7 @@ const template = <Electron.MenuItemConstructorOptions[]> [
|
|||
click: (item, focusedWindow) => {
|
||||
if (focusedWindow) {
|
||||
const { webContents } = focusedWindow
|
||||
const zoomLevel = webContents.getZoomLevel()
|
||||
webContents.setZoomLevel(zoomLevel + 0.5)
|
||||
webContents.zoomLevel += 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -700,8 +699,7 @@ const template = <Electron.MenuItemConstructorOptions[]> [
|
|||
click: (item, focusedWindow) => {
|
||||
if (focusedWindow) {
|
||||
const { webContents } = focusedWindow
|
||||
const zoomLevel = webContents.getZoomLevel()
|
||||
webContents.setZoomLevel(zoomLevel - 0.5)
|
||||
webContents.zoomLevel -= 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue