Skip to content

Commit

Permalink
RocketChat#367 to add visual effect when a message is waiting
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Coppolani committed May 18, 2017
1 parent 73f926c commit 6573ea7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Binary file added src/public/images/linux/changes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/public/images/windows/changes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion src/scripts/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const icons = {

const _iconTray = path.join(__dirname, 'images', icons[process.platform].dir, icons[process.platform].icon || 'icon-tray.png');
const _iconTrayAlert = path.join(__dirname, 'images', icons[process.platform].dir, icons[process.platform].iconAlert || 'icon-tray-alert.png');
const _iconTBAlert = path.join(__dirname, 'images', icons[process.platform].dir, icons[process.platform].iconAlert || 'changes.png'); //#367 to add visual effect when a message is waiting

function createAppTray () {
const _tray = new Tray(_iconTray);
Expand Down Expand Up @@ -102,8 +103,16 @@ function showTrayAlert (showAlert, title) {
if (mainWindow.tray === null || mainWindow.tray === undefined) {
return;
}

if (!mainWindow.isVisible()) {
mainWindow.minimize(); //#367 to show minimized
mainWindow.blur(); //#367 to keep on blinking
}
mainWindow.flashFrame(showAlert);
if (showAlert) {
mainWindow.setOverlayIcon(_iconTBAlert, "unsaved changes"); //#367 to add visual effect when a message is waiting
} else {
mainWindow.setOverlayIcon(null,"saved changes"); //#367 reset visual effect
}
if (process.platform !== 'darwin') {
setImage(title);
} else {
Expand Down

0 comments on commit 6573ea7

Please sign in to comment.