diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app.js | 1 | ||||
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 7 | ||||
-rw-r--r-- | src/config.js | 9 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 2 | ||||
-rw-r--r-- | src/i18n/locales/defaultMessages.json | 2 | ||||
-rw-r--r-- | src/i18n/messages/src/containers/settings/EditSettingsScreen.json | 2 | ||||
-rw-r--r-- | src/index.js | 8 | ||||
m--------- | src/internal-server | 0 | ||||
-rw-r--r-- | src/lib/Menu.js | 2 | ||||
-rw-r--r-- | src/lib/Tray.js | 14 |
10 files changed, 25 insertions, 22 deletions
diff --git a/src/app.js b/src/app.js index 1c2f66592..d8fa37014 100644 --- a/src/app.js +++ b/src/app.js | |||
@@ -52,7 +52,6 @@ smoothScroll.polyfill(); | |||
52 | 52 | ||
53 | // Basic electron Setup | 53 | // Basic electron Setup |
54 | webFrame.setVisualZoomLevelLimits(1, 1); | 54 | webFrame.setVisualZoomLevelLimits(1, 1); |
55 | webFrame.setLayoutZoomLevelLimits(0, 0); | ||
56 | 55 | ||
57 | window.addEventListener('load', () => { | 56 | window.addEventListener('load', () => { |
58 | const serverApi = new ServerApi(); | 57 | const serverApi = new ServerApi(); |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 2797a2dce..6017252bc 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -252,6 +252,9 @@ export default @observer class EditSettingsForm extends Component { | |||
252 | <Toggle field={form.$('runInBackground')} /> | 252 | <Toggle field={form.$('runInBackground')} /> |
253 | <Toggle field={form.$('enableSystemTray')} /> | 253 | <Toggle field={form.$('enableSystemTray')} /> |
254 | {isTrayEnabled && <Toggle field={form.$('startMinimized')} />} | 254 | {isTrayEnabled && <Toggle field={form.$('startMinimized')} />} |
255 | {process.platform === 'win32' && ( | ||
256 | <Toggle field={form.$('minimizeToSystemTray')} /> | ||
257 | )} | ||
255 | <Toggle field={form.$('privateNotifications')} /> | 258 | <Toggle field={form.$('privateNotifications')} /> |
256 | <Toggle field={form.$('showServiceNavigationBar')} /> | 259 | <Toggle field={form.$('showServiceNavigationBar')} /> |
257 | 260 | ||
@@ -279,10 +282,6 @@ export default @observer class EditSettingsForm extends Component { | |||
279 | 282 | ||
280 | <Hr /> | 283 | <Hr /> |
281 | 284 | ||
282 | {process.platform === 'win32' && ( | ||
283 | <Toggle field={form.$('minimizeToSystemTray')} /> | ||
284 | )} | ||
285 | |||
286 | <Input | 285 | <Input |
287 | placeholder="Server" | 286 | placeholder="Server" |
288 | onChange={e => this.submit(e)} | 287 | onChange={e => this.submit(e)} |
diff --git a/src/config.js b/src/config.js index d19a4b8b4..895852ed8 100644 --- a/src/config.js +++ b/src/config.js | |||
@@ -1,8 +1,7 @@ | |||
1 | import electron from 'electron'; | 1 | import electron from 'electron'; |
2 | import path from 'path'; | ||
3 | import isDevMode from 'electron-is-dev'; | 2 | import isDevMode from 'electron-is-dev'; |
4 | import ms from 'ms'; | 3 | import ms from 'ms'; |
5 | 4 | import path from 'path'; | |
6 | import { asarPath } from './helpers/asar-helpers'; | 5 | import { asarPath } from './helpers/asar-helpers'; |
7 | 6 | ||
8 | const app = process.type === 'renderer' ? electron.remote.app : electron.app; | 7 | const app = process.type === 'renderer' ? electron.remote.app : electron.app; |
@@ -126,11 +125,11 @@ if (process.env.FERDI_APPDATA_DIR != null) { | |||
126 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); | 125 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); |
127 | app.setPath('userData', path.join(app.getPath('appData'))); | 126 | app.setPath('userData', path.join(app.getPath('appData'))); |
128 | } else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { | 127 | } else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { |
129 | app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.getName()}AppData`); | 128 | app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.name}AppData`); |
130 | app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}AppData`)); | 129 | app.setPath('userData', path.join(app.getPath('appData'), `${app.name}AppData`)); |
131 | } else if (process.platform === 'win32') { | 130 | } else if (process.platform === 'win32') { |
132 | app.setPath('appData', process.env.APPDATA); | 131 | app.setPath('appData', process.env.APPDATA); |
133 | app.setPath('userData', path.join(app.getPath('appData'), app.getName())); | 132 | app.setPath('userData', path.join(app.getPath('appData'), app.name)); |
134 | } | 133 | } |
135 | 134 | ||
136 | export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); | 135 | export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 595cfdcc7..8eb7c3b82 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -44,7 +44,7 @@ const messages = defineMessages({ | |||
44 | }, | 44 | }, |
45 | enableSystemTray: { | 45 | enableSystemTray: { |
46 | id: 'settings.app.form.enableSystemTray', | 46 | id: 'settings.app.form.enableSystemTray', |
47 | defaultMessage: '!!!Show Ferdi in system tray', | 47 | defaultMessage: '!!!Always show Ferdi in system tray', |
48 | }, | 48 | }, |
49 | minimizeToSystemTray: { | 49 | minimizeToSystemTray: { |
50 | id: 'settings.app.form.minimizeToSystemTray', | 50 | id: 'settings.app.form.minimizeToSystemTray', |
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 6ac9153a4..17f77b609 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json | |||
@@ -4136,7 +4136,7 @@ | |||
4136 | } | 4136 | } |
4137 | }, | 4137 | }, |
4138 | { | 4138 | { |
4139 | "defaultMessage": "!!!Show Ferdi in system tray", | 4139 | "defaultMessage": "!!!Always show Ferdi in system tray", |
4140 | "end": { | 4140 | "end": { |
4141 | "column": 3, | 4141 | "column": 3, |
4142 | "line": 48 | 4142 | "line": 48 |
diff --git a/src/i18n/messages/src/containers/settings/EditSettingsScreen.json b/src/i18n/messages/src/containers/settings/EditSettingsScreen.json index 22417f340..d2e53d625 100644 --- a/src/i18n/messages/src/containers/settings/EditSettingsScreen.json +++ b/src/i18n/messages/src/containers/settings/EditSettingsScreen.json | |||
@@ -53,7 +53,7 @@ | |||
53 | }, | 53 | }, |
54 | { | 54 | { |
55 | "id": "settings.app.form.enableSystemTray", | 55 | "id": "settings.app.form.enableSystemTray", |
56 | "defaultMessage": "!!!Show Ferdi in system tray", | 56 | "defaultMessage": "!!!Always show Ferdi in system tray", |
57 | "file": "src/containers/settings/EditSettingsScreen.js", | 57 | "file": "src/containers/settings/EditSettingsScreen.js", |
58 | "start": { | 58 | "start": { |
59 | "line": 45, | 59 | "line": 45, |
diff --git a/src/index.js b/src/index.js index 46230abd6..167d3897a 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -14,15 +14,15 @@ if (process.env.FERDI_APPDATA_DIR != null) { | |||
14 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); | 14 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); |
15 | app.setPath('userData', path.join(app.getPath('appData'))); | 15 | app.setPath('userData', path.join(app.getPath('appData'))); |
16 | } else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { | 16 | } else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { |
17 | app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.getName()}AppData`); | 17 | app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.name}AppData`); |
18 | app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}AppData`)); | 18 | app.setPath('userData', path.join(app.getPath('appData'), `${app.name}AppData`)); |
19 | } else if (process.platform === 'win32') { | 19 | } else if (process.platform === 'win32') { |
20 | app.setPath('appData', process.env.APPDATA); | 20 | app.setPath('appData', process.env.APPDATA); |
21 | app.setPath('userData', path.join(app.getPath('appData'), app.getName())); | 21 | app.setPath('userData', path.join(app.getPath('appData'), app.name)); |
22 | } | 22 | } |
23 | 23 | ||
24 | if (isDevMode) { | 24 | if (isDevMode) { |
25 | app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); | 25 | app.setPath('userData', path.join(app.getPath('appData'), `${app.name}Dev`)); |
26 | } | 26 | } |
27 | 27 | ||
28 | /* eslint-disable import/first */ | 28 | /* eslint-disable import/first */ |
diff --git a/src/internal-server b/src/internal-server | |||
Subproject 24c8ea3aad5b828297686a032103d2cc4eabc37 | Subproject 3ad266e1371075612ce866332472595bfd89a5d | ||
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 6167f1c59..f2669a106 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -825,7 +825,7 @@ export default class FranzMenu { | |||
825 | }); | 825 | }); |
826 | 826 | ||
827 | tpl.unshift({ | 827 | tpl.unshift({ |
828 | label: isMac ? app.getName() : intl.formatMessage(menuItems.file), | 828 | label: isMac ? app.name : intl.formatMessage(menuItems.file), |
829 | accelerator: 'Alt+F', | 829 | accelerator: 'Alt+F', |
830 | submenu: [ | 830 | submenu: [ |
831 | { | 831 | { |
diff --git a/src/lib/Tray.js b/src/lib/Tray.js index c0d936599..84ee8e3bb 100644 --- a/src/lib/Tray.js +++ b/src/lib/Tray.js | |||
@@ -1,5 +1,5 @@ | |||
1 | import { | 1 | import { |
2 | app, Tray, Menu, systemPreferences, nativeTheme, nativeImage, | 2 | app, Menu, nativeImage, nativeTheme, systemPreferences, Tray, |
3 | } from 'electron'; | 3 | } from 'electron'; |
4 | import path from 'path'; | 4 | import path from 'path'; |
5 | 5 | ||
@@ -37,14 +37,20 @@ export default class TrayIcon { | |||
37 | ]; | 37 | ]; |
38 | 38 | ||
39 | const trayMenu = Menu.buildFromTemplate(trayMenuTemplate); | 39 | const trayMenu = Menu.buildFromTemplate(trayMenuTemplate); |
40 | this.trayIcon.setContextMenu(trayMenu); | ||
41 | 40 | ||
42 | this.trayIcon.on('click', () => { | 41 | this.trayIcon.on('click', () => { |
43 | if (app.mainWindow.isMinimized()) { | 42 | if (app.mainWindow.isMinimized()) { |
44 | app.mainWindow.restore(); | 43 | app.mainWindow.restore(); |
44 | } else if (app.mainWindow.isVisible()) { | ||
45 | app.mainWindow.hide(); | ||
46 | } else { | ||
47 | app.mainWindow.show(); | ||
48 | app.mainWindow.focus(); | ||
45 | } | 49 | } |
46 | app.mainWindow.show(); | 50 | }); |
47 | app.mainWindow.focus(); | 51 | |
52 | this.trayIcon.on('right-click', () => { | ||
53 | this.trayIcon.popUpContextMenu(trayMenu); | ||
48 | }); | 54 | }); |
49 | 55 | ||
50 | if (process.platform === 'darwin') { | 56 | if (process.platform === 'darwin') { |