aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2020-01-31 17:24:30 +0100
committerLibravatar GitHub <noreply@github.com>2020-01-31 17:24:30 +0100
commit9277d42ee8fd6d9e3eccf948f71c8688f726784e (patch)
tree6f167ea9eb2ed50a079596048993a79c7aeb9447 /src/lib
parentUpdate (diff)
parentFix lint (diff)
downloadferdium-app-9277d42ee8fd6d9e3eccf948f71c8688f726784e.tar.gz
ferdium-app-9277d42ee8fd6d9e3eccf948f71c8688f726784e.tar.zst
ferdium-app-9277d42ee8fd6d9e3eccf948f71c8688f726784e.zip
Merge branch 'develop' into start-in-tray
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Menu.js37
-rw-r--r--src/lib/Tray.js4
2 files changed, 21 insertions, 20 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js
index 826fe843f..303845e55 100644
--- a/src/lib/Menu.js
+++ b/src/lib/Menu.js
@@ -392,10 +392,10 @@ const _templateFactory = intl => [
392 accelerator: 'Cmd+plus', 392 accelerator: 'Cmd+plus',
393 click() { 393 click() {
394 const activeService = getActiveWebview(); 394 const activeService = getActiveWebview();
395 activeService.getZoomLevel((level) => { 395 const level = activeService.getZoomLevel();
396 // level 9 =~ +300% and setZoomLevel wouldnt zoom in further 396
397 if (level < 9) activeService.setZoomLevel(level + 1); 397 // level 9 =~ +300% and setZoomLevel wouldnt zoom in further
398 }); 398 if (level < 9) activeService.setZoomLevel(level + 1);
399 }, 399 },
400 }, 400 },
401 { 401 {
@@ -403,10 +403,10 @@ const _templateFactory = intl => [
403 accelerator: 'Cmd+-', 403 accelerator: 'Cmd+-',
404 click() { 404 click() {
405 const activeService = getActiveWebview(); 405 const activeService = getActiveWebview();
406 activeService.getZoomLevel((level) => { 406 const level = activeService.getZoomLevel();
407 // level -9 =~ -50% and setZoomLevel wouldnt zoom out further 407
408 if (level > -9) activeService.setZoomLevel(level - 1); 408 // level -9 =~ -50% and setZoomLevel wouldnt zoom out further
409 }); 409 if (level > -9) activeService.setZoomLevel(level - 1);
410 }, 410 },
411 }, 411 },
412 { 412 {
@@ -598,10 +598,10 @@ const _titleBarTemplateFactory = intl => [
598 accelerator: `${ctrlKey}+=`, 598 accelerator: `${ctrlKey}+=`,
599 click() { 599 click() {
600 const activeService = getActiveWebview(); 600 const activeService = getActiveWebview();
601 activeService.getZoomLevel((level) => { 601 const level = activeService.getZoomLevel();
602 // level 9 =~ +300% and setZoomLevel wouldnt zoom in further 602
603 if (level < 9) activeService.setZoomLevel(level + 1); 603 // level 9 =~ +300% and setZoomLevel wouldnt zoom in further
604 }); 604 if (level < 9) activeService.setZoomLevel(level + 1);
605 }, 605 },
606 }, 606 },
607 { 607 {
@@ -609,10 +609,10 @@ const _titleBarTemplateFactory = intl => [
609 accelerator: `${ctrlKey}+-`, 609 accelerator: `${ctrlKey}+-`,
610 click() { 610 click() {
611 const activeService = getActiveWebview(); 611 const activeService = getActiveWebview();
612 activeService.getZoomLevel((level) => { 612 const level = activeService.getZoomLevel();
613 // level -9 =~ -50% and setZoomLevel wouldnt zoom out further 613
614 if (level > -9) activeService.setZoomLevel(level - 1); 614 // level -9 =~ -50% and setZoomLevel wouldnt zoom out further
615 }); 615 if (level > -9) activeService.setZoomLevel(level - 1);
616 }, 616 },
617 }, 617 },
618 { 618 {
@@ -800,7 +800,7 @@ export default class FranzMenu {
800 }, { 800 }, {
801 label: intl.formatMessage(menuItems.lockFerdi), 801 label: intl.formatMessage(menuItems.lockFerdi),
802 accelerator: 'CmdOrCtrl+Shift+L', 802 accelerator: 'CmdOrCtrl+Shift+L',
803 enabled: this.stores.settings.app.lockingFeatureEnabled, 803 enabled: this.stores.user.isLoggedIn && this.stores.settings.app.lockingFeatureEnabled,
804 click() { 804 click() {
805 // Disable lock first - otherwise the application might not update correctly 805 // Disable lock first - otherwise the application might not update correctly
806 actions.settings.update({ 806 actions.settings.update({
@@ -963,7 +963,8 @@ export default class FranzMenu {
963 963
964 this.currentTemplate = tpl; 964 this.currentTemplate = tpl;
965 const menu = Menu.buildFromTemplate(tpl); 965 const menu = Menu.buildFromTemplate(tpl);
966 Menu.setApplicationMenu(menu); 966 const lockedMenu = Menu.buildFromTemplate([]);
967 Menu.setApplicationMenu(this.stores.user.isLoggedIn && this.stores.settings.app.locked ? lockedMenu : menu);
967 } 968 }
968 969
969 serviceTpl() { 970 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 @@
1import { 1import {
2 app, Tray, Menu, systemPreferences, nativeImage, 2 app, Tray, Menu, systemPreferences, nativeTheme, nativeImage,
3} from 'electron'; 3} from 'electron';
4import path from 'path'; 4import 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