mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +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" };
|
return { action: "deny" };
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
win.webContents.on("before-input-event", (e, input) => {
|
||||||
|
// console.log("before-input-event", input);
|
||||||
|
});
|
||||||
win.on(
|
win.on(
|
||||||
"resize",
|
"resize",
|
||||||
debounce(400, (e) => mainResizeHandler(e, waveWindow.oid, win))
|
debounce(400, (e) => mainResizeHandler(e, waveWindow.oid, win))
|
||||||
@ -673,13 +676,34 @@ function makeAppMenu() {
|
|||||||
type: "separator",
|
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",
|
type: "separator",
|
||||||
|
Loading…
Reference in New Issue
Block a user