Skip to content

TagSpaces is an offline, open source, document manager with tagging support

detect single clicks to Tray Icon

kristiyandd78c0d7d60b54
diff --git a/data/electron/main.js b/data/electron/main.js
index 0d70f7729..24bde6319 100644
--- a/data/electron/main.js
+++ b/data/electron/main.js
@@ -46,7 +46,8 @@ app.on('window-all-closed', function() {
//}
});
-app.on('ready', function() {
+app.on('ready', function(event) {
+ console.log(event);
mainWindow = new BrowserWindow({width: 1280, height: 768});
//var indexPath = 'file://' + __dirname + '/index.html';
@@ -95,6 +96,26 @@ app.on('ready', function() {
mainWindow.show();
}
},
+ {
+ label: 'New File', click: function(){
+ mainWindow.show();
+ }
+ },
+ {
+ label: 'Previous File', click: function(){
+ mainWindow.show();
+ }
+ },
+ {
+ label: 'Stop Playback', click: function(){
+ mainWindow.show();
+ }
+ },
+ {
+ label: 'Resume Playback', click: function(){
+ mainWindow.show();
+ }
+ },
//{
// label: 'Settings',
// click: function () {
@@ -104,6 +125,7 @@ app.on('ready', function() {
{
label: 'Quit',
click: function (event) {
+ console.log(event);
app.quit();
//event.ipcRenderer.send('remove-tray');
//ipcRenderer.send('window-all-closed');
@@ -111,6 +133,10 @@ app.on('ready', function() {
}
];
+ trayIcon.on('clicked', function() {
+ mainWindow.show();
+ });
+
var trayMenu = Menu.buildFromTemplate(trayMenuTemplate);
trayIcon.setToolTip('TagSpaces App');
trayIcon.setContextMenu(trayMenu);