Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(Service): Fix service zoom (cmd/ctrl+ & cmd/ctrl-)
  • Loading branch information
DominikGuzei committed Mar 5, 2019
1 parent 532171b commit 91a0f59
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,6 +2,7 @@ node_modules
flow-typed
out
.DS_Store
.idea
build
.tmp
.stage
Expand Down
28 changes: 24 additions & 4 deletions src/lib/Menu.js
Expand Up @@ -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',
Expand Down

0 comments on commit 91a0f59

Please sign in to comment.