From c24ef6ea4b1ef54ef40a7e33e3d3c681e64c0fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20H=C3=A4usler?= Date: Mon, 30 Nov 2020 09:08:48 +0100 Subject: [PATCH] Support negative zoom (#2412) --- src/main/menu/actions/window.js | 2 +- src/renderer/commands/index.js | 28 ++++++++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/main/menu/actions/window.js b/src/main/menu/actions/window.js index 01a0a077..bd0472ce 100644 --- a/src/main/menu/actions/window.js +++ b/src/main/menu/actions/window.js @@ -17,5 +17,5 @@ export const zoomOut = win => { const { webContents } = win const zoom = webContents.getZoomFactor() // WORKAROUND: We need to set zoom on the browser window due to Electron#16018. - webContents.send('mt::window-zoom', Math.max(1.0, zoom - 0.125)) + webContents.send('mt::window-zoom', Math.max(0.5, zoom - 0.125)) } diff --git a/src/renderer/commands/index.js b/src/renderer/commands/index.js index 478f7f1f..89c01a23 100644 --- a/src/renderer/commands/index.js +++ b/src/renderer/commands/index.js @@ -531,38 +531,50 @@ const commands = [ description: 'Window: Zoom...', subcommands: [{ id: 'file.zoom-0', + description: '0.625', + value: 0.625 + }, { + id: 'file.zoom-1', + description: '0.75', + value: 0.75 + }, { + id: 'file.zoom-2', + description: '0.875', + value: 0.875 + }, { + id: 'file.zoom-3', description: '1.0', value: 1.0 }, { - id: 'file.zoom-1', + id: 'file.zoom-4', description: '1.125', value: 1.125 }, { - id: 'file.zoom-2', + id: 'file.zoom-5', description: '1.25', value: 1.25 }, { - id: 'file.zoom-3', + id: 'file.zoom-6', description: '1.375', value: 1.375 }, { - id: 'file.zoom-4', + id: 'file.zoom-7', description: '1.5', value: 1.5 }, { - id: 'file.zoom-5', + id: 'file.zoom-8', description: '1.625', value: 1.625 }, { - id: 'file.zoom-6', + id: 'file.zoom-9', description: '1.75', value: 1.75 }, { - id: 'file.zoom-7', + id: 'file.zoom-10', description: '1.875', value: 1.875 }, { - id: 'file.zoom-8', + id: 'file.zoom-11', description: '2.0', value: 2.0 }],