diff options
author | 2020-01-31 21:03:49 +0100 | |
---|---|---|
committer | 2020-01-31 21:03:49 +0100 | |
commit | d54ceb639862788c053e21f217ca39ac36003db6 (patch) | |
tree | 40bfd8bb6a8a85c222f9c67d7dd862a835394e80 /src/lib | |
parent | Add publish debug log option (diff) | |
parent | Merge branch 'develop' of https://github.com/getferdi/ferdi into develop (diff) | |
download | ferdium-app-d54ceb639862788c053e21f217ca39ac36003db6.tar.gz ferdium-app-d54ceb639862788c053e21f217ca39ac36003db6.tar.zst ferdium-app-d54ceb639862788c053e21f217ca39ac36003db6.zip |
Merge branch 'develop' into publish-debug
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 37 | ||||
-rw-r--r-- | src/lib/Tray.js | 4 |
2 files changed, 21 insertions, 20 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index a858ec993..6167f1c59 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -396,10 +396,10 @@ const _templateFactory = intl => [ | |||
396 | accelerator: 'Cmd+plus', | 396 | accelerator: 'Cmd+plus', |
397 | click() { | 397 | click() { |
398 | const activeService = getActiveWebview(); | 398 | const activeService = getActiveWebview(); |
399 | activeService.getZoomLevel((level) => { | 399 | const level = activeService.getZoomLevel(); |
400 | // level 9 =~ +300% and setZoomLevel wouldnt zoom in further | 400 | |
401 | if (level < 9) activeService.setZoomLevel(level + 1); | 401 | // level 9 =~ +300% and setZoomLevel wouldnt zoom in further |
402 | }); | 402 | if (level < 9) activeService.setZoomLevel(level + 1); |
403 | }, | 403 | }, |
404 | }, | 404 | }, |
405 | { | 405 | { |
@@ -407,10 +407,10 @@ const _templateFactory = intl => [ | |||
407 | accelerator: 'Cmd+-', | 407 | accelerator: 'Cmd+-', |
408 | click() { | 408 | click() { |
409 | const activeService = getActiveWebview(); | 409 | const activeService = getActiveWebview(); |
410 | activeService.getZoomLevel((level) => { | 410 | const level = activeService.getZoomLevel(); |
411 | // level -9 =~ -50% and setZoomLevel wouldnt zoom out further | 411 | |
412 | if (level > -9) activeService.setZoomLevel(level - 1); | 412 | // level -9 =~ -50% and setZoomLevel wouldnt zoom out further |
413 | }); | 413 | if (level > -9) activeService.setZoomLevel(level - 1); |
414 | }, | 414 | }, |
415 | }, | 415 | }, |
416 | { | 416 | { |
@@ -602,10 +602,10 @@ const _titleBarTemplateFactory = intl => [ | |||
602 | accelerator: `${ctrlKey}+=`, | 602 | accelerator: `${ctrlKey}+=`, |
603 | click() { | 603 | click() { |
604 | const activeService = getActiveWebview(); | 604 | const activeService = getActiveWebview(); |
605 | activeService.getZoomLevel((level) => { | 605 | const level = activeService.getZoomLevel(); |
606 | // level 9 =~ +300% and setZoomLevel wouldnt zoom in further | 606 | |
607 | if (level < 9) activeService.setZoomLevel(level + 1); | 607 | // level 9 =~ +300% and setZoomLevel wouldnt zoom in further |
608 | }); | 608 | if (level < 9) activeService.setZoomLevel(level + 1); |
609 | }, | 609 | }, |
610 | }, | 610 | }, |
611 | { | 611 | { |
@@ -613,10 +613,10 @@ const _titleBarTemplateFactory = intl => [ | |||
613 | accelerator: `${ctrlKey}+-`, | 613 | accelerator: `${ctrlKey}+-`, |
614 | click() { | 614 | click() { |
615 | const activeService = getActiveWebview(); | 615 | const activeService = getActiveWebview(); |
616 | activeService.getZoomLevel((level) => { | 616 | const level = activeService.getZoomLevel(); |
617 | // level -9 =~ -50% and setZoomLevel wouldnt zoom out further | 617 | |
618 | if (level > -9) activeService.setZoomLevel(level - 1); | 618 | // level -9 =~ -50% and setZoomLevel wouldnt zoom out further |
619 | }); | 619 | if (level > -9) activeService.setZoomLevel(level - 1); |
620 | }, | 620 | }, |
621 | }, | 621 | }, |
622 | { | 622 | { |
@@ -804,7 +804,7 @@ export default class FranzMenu { | |||
804 | }, { | 804 | }, { |
805 | label: intl.formatMessage(menuItems.lockFerdi), | 805 | label: intl.formatMessage(menuItems.lockFerdi), |
806 | accelerator: 'CmdOrCtrl+Shift+L', | 806 | accelerator: 'CmdOrCtrl+Shift+L', |
807 | enabled: this.stores.settings.app.lockingFeatureEnabled, | 807 | enabled: this.stores.user.isLoggedIn && this.stores.settings.app.lockingFeatureEnabled, |
808 | click() { | 808 | click() { |
809 | // Disable lock first - otherwise the application might not update correctly | 809 | // Disable lock first - otherwise the application might not update correctly |
810 | actions.settings.update({ | 810 | actions.settings.update({ |
@@ -967,7 +967,8 @@ export default class FranzMenu { | |||
967 | 967 | ||
968 | this.currentTemplate = tpl; | 968 | this.currentTemplate = tpl; |
969 | const menu = Menu.buildFromTemplate(tpl); | 969 | const menu = Menu.buildFromTemplate(tpl); |
970 | Menu.setApplicationMenu(menu); | 970 | const lockedMenu = Menu.buildFromTemplate([]); |
971 | Menu.setApplicationMenu(this.stores.user.isLoggedIn && this.stores.settings.app.locked ? lockedMenu : menu); | ||
971 | } | 972 | } |
972 | 973 | ||
973 | serviceTpl() { | 974 | serviceTpl() { |
diff --git a/src/lib/Tray.js b/src/lib/Tray.js index 90974de3f..c0d936599 100644 --- a/src/lib/Tray.js +++ b/src/lib/Tray.js | |||
@@ -1,5 +1,5 @@ | |||
1 | import { | 1 | import { |
2 | app, Tray, Menu, systemPreferences, nativeImage, | 2 | app, Tray, Menu, systemPreferences, nativeTheme, nativeImage, |
3 | } from 'electron'; | 3 | } from 'electron'; |
4 | import path from 'path'; | 4 | import path from 'path'; |
5 | 5 | ||
@@ -86,7 +86,7 @@ export default class TrayIcon { | |||
86 | _getAsset(type, asset) { | 86 | _getAsset(type, asset) { |
87 | let { platform } = process; | 87 | let { platform } = process; |
88 | 88 | ||
89 | if (platform === 'darwin' && systemPreferences.isDarkMode()) { | 89 | if (platform === 'darwin' && nativeTheme.shouldUseDarkColors) { |
90 | platform = `${platform}-dark`; | 90 | platform = `${platform}-dark`; |
91 | } | 91 | } |
92 | 92 | ||