git ssb

16+

Dominic / patchbay



Commit 1c52cfcf601897aad8909bfa4a03a47a9c6da3f2

Merge pull request #82 from pietgeursen/ctrl-zoom

Adds ctrl+scroll zooming in electron.
mix irving authored on 2/3/2017, 3:01:31 AM
GitHub committed on 2/3/2017, 3:01:31 AM
Parent: 2a6a22b5b33a8c6903dd250baa5b8d2b85f4a615
Parent: 868a6b6fd80c1defa4ab9681d5a893fdc04765e6

Files changed

modules_core/tabs.jschanged
modules_core/tabs.jsView
@@ -190,8 +190,19 @@
190190 errorsContent.appendChild(el)
191191 })
192192
193193 if (process.versions.electron) {
194 + var {webFrame} = require('electron')
195 +
196 + window.addEventListener('mousewheel', function (ev) {
197 + var {ctrlKey, deltaY} = ev
198 + if(ctrlKey){
199 + var direction = (deltaY / Math.abs(deltaY))
200 + var currentZoom = webFrame.getZoomLevel()
201 + webFrame.setZoomLevel(currentZoom - direction)
202 + }
203 + })
204 +
194205 window.addEventListener('contextmenu', function (ev) {
195206 ev.preventDefault()
196207 var remote = require('electron').remote
197208 var Menu = remote.Menu

Built with git-ssb-web