Skip to content
Permalink
Browse files

fix(Service): Fix service zoom (cmd/ctrl+ & cmd/ctrl-)

  • Loading branch information...
DominikGuzei committed Mar 5, 2019
1 parent 532171b commit 91a0f59d04d95fae58e78ab17f0ee6e9d2cc1858
Showing with 25 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +24 −4 src/lib/Menu.js
@@ -2,6 +2,7 @@ node_modules
flow-typed
out
.DS_Store
.idea
build
.tmp
.stage
@@ -239,16 +239,36 @@ const _templateFactory = intl => [
},
{
label: intl.formatMessage(menuItems.resetZoom),
role: 'resetzoom',
accelerator: 'Cmd+0',
click() {
getActiveWebview().setZoomLevel(0);
},
},
{
label: intl.formatMessage(menuItems.zoomIn),
// accelerator: 'Cmd+=',
role: 'zoomin',
accelerator: 'Cmd+plus',
click() {
const activeService = getActiveWebview();
activeService.getZoomLevel((level) => {
// level 9 =~ +300% and setZoomLevel wouldnt zoom in further
if (level < 9) {
activeService.setZoomLevel(level + 1);
}
});
},
},
{
label: intl.formatMessage(menuItems.zoomOut),
role: 'zoomout',
accelerator: 'Cmd+-',
click() {
const activeService = getActiveWebview();
activeService.getZoomLevel((level) => {
// level -9 =~ -50% and setZoomLevel wouldnt zoom out further
if (level > -9) {
activeService.setZoomLevel(level - 1);
}
});
},
},
{
type: 'separator',

0 comments on commit 91a0f59

Please sign in to comment.
You can’t perform that action at this time.