mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-17 20:51:55 +01:00
fix zoom in/out to affect webcontents not webview
This commit is contained in:
parent
8d29f7f934
commit
4e88a27d9e
@ -390,6 +390,9 @@ function createBrowserWindow(
|
||||
return { action: "deny" };
|
||||
});
|
||||
});
|
||||
win.webContents.on("before-input-event", (e, input) => {
|
||||
// console.log("before-input-event", input);
|
||||
});
|
||||
win.on(
|
||||
"resize",
|
||||
debounce(400, (e) => mainResizeHandler(e, waveWindow.oid, win))
|
||||
@ -673,13 +676,34 @@ function makeAppMenu() {
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
role: "resetZoom",
|
||||
label: "Actual Size",
|
||||
accelerator: "CommandOrControl+0",
|
||||
click: (_, window) => {
|
||||
window.webContents.setZoomFactor(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
role: "zoomIn",
|
||||
label: "Zoom In",
|
||||
accelerator: "CommandOrControl+=",
|
||||
click: (_, window) => {
|
||||
window.webContents.setZoomFactor(window.webContents.getZoomFactor() + 0.2);
|
||||
},
|
||||
},
|
||||
{
|
||||
role: "zoomOut",
|
||||
label: "Zoom In (hidden)",
|
||||
accelerator: "CommandOrControl+Shift+=",
|
||||
click: (_, window) => {
|
||||
window.webContents.setZoomFactor(window.webContents.getZoomFactor() + 0.2);
|
||||
},
|
||||
visible: false,
|
||||
acceleratorWorksWhenHidden: true,
|
||||
},
|
||||
{
|
||||
label: "Zoom Out",
|
||||
accelerator: "CommandOrControl+-",
|
||||
click: (_, window) => {
|
||||
window.webContents.setZoomFactor(window.webContents.getZoomFactor() - 0.2);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
|
Loading…
Reference in New Issue
Block a user