diff --git a/.gitignore b/.gitignore index ae75970c..1197a441 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ npm-debug.log test-results.xml test_config.json +.idea diff --git a/CHANGELOG.md b/CHANGELOG.md index 37640dfd..883a94e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Release date: TBD - Invalidate cache before load, to make server upgrades easy - Removed misleading shortcuts from tray menu, as they didn't work - Ctrl/Command+F puts cursor in search box to search in current channel. +- Add access to settings through tray menu #### Windows - Added an option to toogle the red dot icon for unread messages (default is on). diff --git a/docs/setup.md b/docs/setup.md index 0ffeb318..e41f6bdb 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -78,6 +78,7 @@ You have to configure the application to interact with your teams. - Windows: Press `Alt` key to bring up the menu at the top of the window, then click `File -> Settings`. - OS X: Click `Mattermost` from the menu at the top of the screen, then click `Preferences...`. - Linux: Click `File -> Settings` on the menu. + - All : right-click on tray icon and click `Settings` 2. Press `+` button next to the "Teams" label. diff --git a/src/main/menus/tray.js b/src/main/menus/tray.js index b79c4c87..2ac3ef4f 100644 --- a/src/main/menus/tray.js +++ b/src/main/menus/tray.js @@ -12,12 +12,7 @@ function createTemplate(mainWindow, config) { return { label: team.name, click: (item, focusedWindow) => { - if (mainWindow.isMinimized()) { - mainWindow.restore(); - } - else { - mainWindow.show(); - } + showOrRestore(mainWindow); mainWindow.webContents.send('switch-tab', i); if (process.platform === 'darwin') { @@ -28,6 +23,14 @@ function createTemplate(mainWindow, config) { }; }), { type: 'separator' + }, { + label: 'Settings', + click: () => { + mainWindow.loadURL('file://' + __dirname + '/browser/settings.html'); + showOrRestore(mainWindow); + } + }, { + type: 'separator' }, { role: 'quit' } @@ -39,6 +42,10 @@ var createMenu = function(mainWindow, config) { return Menu.buildFromTemplate(createTemplate(mainWindow, config)); }; +function showOrRestore(window) { + window.isMinimized() ? window.restore() : window.show() +} + module.exports = { createMenu: createMenu };