diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index c378619ad..93010de08 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -239,16 +239,36 @@ const _templateFactory = intl => [ | |||
239 | }, | 239 | }, |
240 | { | 240 | { |
241 | label: intl.formatMessage(menuItems.resetZoom), | 241 | label: intl.formatMessage(menuItems.resetZoom), |
242 | role: 'resetzoom', | 242 | accelerator: 'Cmd+0', |
243 | click() { | ||
244 | getActiveWebview().setZoomLevel(0); | ||
245 | }, | ||
243 | }, | 246 | }, |
244 | { | 247 | { |
245 | label: intl.formatMessage(menuItems.zoomIn), | 248 | label: intl.formatMessage(menuItems.zoomIn), |
246 | // accelerator: 'Cmd+=', | 249 | accelerator: 'Cmd+plus', |
247 | role: 'zoomin', | 250 | click() { |
251 | const activeService = getActiveWebview(); | ||
252 | activeService.getZoomLevel((level) => { | ||
253 | // level 9 =~ +300% and setZoomLevel wouldnt zoom in further | ||
254 | if (level < 9) { | ||
255 | activeService.setZoomLevel(level + 1); | ||
256 | } | ||
257 | }); | ||
258 | }, | ||
248 | }, | 259 | }, |
249 | { | 260 | { |
250 | label: intl.formatMessage(menuItems.zoomOut), | 261 | label: intl.formatMessage(menuItems.zoomOut), |
251 | role: 'zoomout', | 262 | accelerator: 'Cmd+-', |
263 | click() { | ||
264 | const activeService = getActiveWebview(); | ||
265 | activeService.getZoomLevel((level) => { | ||
266 | // level -9 =~ -50% and setZoomLevel wouldnt zoom out further | ||
267 | if (level > -9) { | ||
268 | activeService.setZoomLevel(level - 1); | ||
269 | } | ||
270 | }); | ||
271 | }, | ||
252 | }, | 272 | }, |
253 | { | 273 | { |
254 | type: 'separator', | 274 | type: 'separator', |