Skip to content

Commit

Permalink
Implement macOS dock support
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Oct 10, 2018
1 parent 4ee273b commit 5a6af52
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ app.on('ready', function() {
function setTray() {
//Tray icon
var trayIconPath = path.join(__dirname, 'img/icon.png');
trayIcon = new Tray(trayIconPath);
const trayContextMenu = Menu.buildFromTemplate([{
label: 'Maximize',
click() {
Expand Down Expand Up @@ -159,8 +158,13 @@ app.on('ready', function() {
});
}
}]);
trayIcon.setToolTip('Altus');
trayIcon.setContextMenu(trayContextMenu);
if (process.platform !== "darwin") {
trayIcon = new Tray(trayIconPath);
trayIcon.setToolTip('Altus');
trayIcon.setContextMenu(trayContextMenu);
} else {
app.dock.setMenu(trayContextMenu);
}
}

function setTheme() {
Expand Down

0 comments on commit 5a6af52

Please sign in to comment.