Draw attention to the window on new messages
// FREEBIE
This commit is contained in:
parent
ea930d53ae
commit
0c9cca08ba
3 changed files with 19 additions and 11 deletions
16
main.js
16
main.js
|
@ -76,7 +76,11 @@ function createWindow () {
|
|||
//sandbox: true,
|
||||
preload: path.join(__dirname, 'preload.js')
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
mainWindow.on('focus', function() {
|
||||
mainWindow.flashFrame(false);
|
||||
});
|
||||
|
||||
// Load locale
|
||||
const locale = 'en'; // FIXME
|
||||
|
@ -177,3 +181,13 @@ app.on('activate', function () {
|
|||
ipc.on('set-badge-count', function(event, count) {
|
||||
app.setBadgeCount(count);
|
||||
});
|
||||
ipc.on('draw-attention', function(event, count) {
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.bounce();
|
||||
} else if (process.platform == 'win32') {
|
||||
mainWindow.flashFrame(true);
|
||||
setTimeout(function() {
|
||||
mainWindow.flashFrame(false);
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue