diff options
author | 2019-03-05 14:44:03 +0100 | |
---|---|---|
committer | 2019-03-05 14:51:53 +0100 | |
commit | 91a0f59d04d95fae58e78ab17f0ee6e9d2cc1858 (patch) | |
tree | c1ae1638ff63d6b3411671b2652d1d73e6e397ea /src/lib | |
parent | Merge branch 'develop' of https://github.com/meetfranz/franz into develop (diff) | |
download | ferdium-app-91a0f59d04d95fae58e78ab17f0ee6e9d2cc1858.tar.gz ferdium-app-91a0f59d04d95fae58e78ab17f0ee6e9d2cc1858.tar.zst ferdium-app-91a0f59d04d95fae58e78ab17f0ee6e9d2cc1858.zip |
fix(Service): Fix service zoom (cmd/ctrl+ & cmd/ctrl-)
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', |