diff options
author | Dominik Guzei <dominik.guzei@gmail.com> | 2019-03-05 17:26:14 +0100 |
---|---|---|
committer | Dominik Guzei <dominik.guzei@gmail.com> | 2019-03-05 17:26:14 +0100 |
commit | cfb8885d728fb63e30ff4a03bc7419f0dce83cf9 (patch) | |
tree | a9a0ce1b3f5198c3becb81e4ef6300aba9b98785 /src | |
parent | fixes appveyor build issue (diff) | |
download | ferdium-app-cfb8885d728fb63e30ff4a03bc7419f0dce83cf9.tar.gz ferdium-app-cfb8885d728fb63e30ff4a03bc7419f0dce83cf9.tar.zst ferdium-app-cfb8885d728fb63e30ff4a03bc7419f0dce83cf9.zip |
use same zooming logic for all os
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Menu.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 93010de08..dce8ab969 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -251,9 +251,7 @@ const _templateFactory = intl => [ | |||
251 | const activeService = getActiveWebview(); | 251 | const activeService = getActiveWebview(); |
252 | activeService.getZoomLevel((level) => { | 252 | activeService.getZoomLevel((level) => { |
253 | // level 9 =~ +300% and setZoomLevel wouldnt zoom in further | 253 | // level 9 =~ +300% and setZoomLevel wouldnt zoom in further |
254 | if (level < 9) { | 254 | if (level < 9) activeService.setZoomLevel(level + 1); |
255 | activeService.setZoomLevel(level + 1); | ||
256 | } | ||
257 | }); | 255 | }); |
258 | }, | 256 | }, |
259 | }, | 257 | }, |
@@ -264,9 +262,7 @@ const _templateFactory = intl => [ | |||
264 | const activeService = getActiveWebview(); | 262 | const activeService = getActiveWebview(); |
265 | activeService.getZoomLevel((level) => { | 263 | activeService.getZoomLevel((level) => { |
266 | // level -9 =~ -50% and setZoomLevel wouldnt zoom out further | 264 | // level -9 =~ -50% and setZoomLevel wouldnt zoom out further |
267 | if (level > -9) { | 265 | if (level > -9) activeService.setZoomLevel(level - 1); |
268 | activeService.setZoomLevel(level - 1); | ||
269 | } | ||
270 | }); | 266 | }); |
271 | }, | 267 | }, |
272 | }, | 268 | }, |
@@ -414,8 +410,10 @@ const _titleBarTemplateFactory = intl => [ | |||
414 | label: intl.formatMessage(menuItems.zoomIn), | 410 | label: intl.formatMessage(menuItems.zoomIn), |
415 | accelerator: `${ctrlKey}+Plus`, | 411 | accelerator: `${ctrlKey}+Plus`, |
416 | click() { | 412 | click() { |
417 | getActiveWebview().getZoomLevel((zoomLevel) => { | 413 | const activeService = getActiveWebview(); |
418 | getActiveWebview().setZoomLevel(zoomLevel === 5 ? zoomLevel : zoomLevel + 1); | 414 | activeService.getZoomLevel((level) => { |
415 | // level 9 =~ +300% and setZoomLevel wouldnt zoom in further | ||
416 | if (level < 9) activeService.setZoomLevel(level + 1); | ||
419 | }); | 417 | }); |
420 | }, | 418 | }, |
421 | }, | 419 | }, |
@@ -423,8 +421,10 @@ const _titleBarTemplateFactory = intl => [ | |||
423 | label: intl.formatMessage(menuItems.zoomOut), | 421 | label: intl.formatMessage(menuItems.zoomOut), |
424 | accelerator: `${ctrlKey}+-`, | 422 | accelerator: `${ctrlKey}+-`, |
425 | click() { | 423 | click() { |
426 | getActiveWebview().getZoomLevel((zoomLevel) => { | 424 | const activeService = getActiveWebview(); |
427 | getActiveWebview().setZoomLevel(zoomLevel === -5 ? zoomLevel : zoomLevel - 1); | 425 | activeService.getZoomLevel((level) => { |
426 | // level -9 =~ -50% and setZoomLevel wouldnt zoom out further | ||
427 | if (level > -9) activeService.setZoomLevel(level - 1); | ||
428 | }); | 428 | }); |
429 | }, | 429 | }, |
430 | }, | 430 | }, |