diff --git a/package.json b/package.json index 47b63af..5a45e41 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,10 @@ "start": "node_modules/.bin/electron .", "test": "echo \"Error: no test specified\" && exit 1", "lint": "eslint -c node_modules/eslint-config/.eslintrc 'src/'", - "build": "npm run create-build-dirs && npm run build-fonts && npm run build-html && npm run build-js && npm run build-less", + "build": "npm run create-build-dirs && npm run build-fonts && npm run build-html && npm run build-img && npm run build-js && npm run build-less", "build-html": "cp src/index.html build/index.html && cp src/audio.html build/audio.html", - "build-fonts": "cp -R node_modules/ionicons/fonts build/ && cp -R node_modules/bootstrap/fonts build/" + "build-fonts": "cp -R node_modules/ionicons/fonts build/ && cp -R node_modules/bootstrap/fonts build/", + "build-img": "cp -R src/img build/" }, "repository": { "type": "git", diff --git a/src/img/icon.png b/src/img/icon.png new file mode 100644 index 0000000..7f05ce3 Binary files /dev/null and b/src/img/icon.png differ diff --git a/src/js/components/navbar.js b/src/js/components/navbar.js index 3409d35..e30d257 100644 --- a/src/js/components/navbar.js +++ b/src/js/components/navbar.js @@ -2,18 +2,22 @@ var React = require('react'); var ipc = window.require('ipc'); var NavBar = React.createClass({ - handleClose: function (evt) { + handleClose: function () { ipc.send('close'); }, + handleHide: function () { + ipc.send('hide'); + }, + render: function () { return ( diff --git a/src/main.js b/src/main.js index 3b5ce7b..4733816 100644 --- a/src/main.js +++ b/src/main.js @@ -21,9 +21,10 @@ app.on('window-all-closed', function () { }); app.on('ready', function () { - icon = new Tray(null); + icon = new Tray(__dirname + '/img/icon.png'); icon.setToolTip('Keyboard Mechanizer | Click to show'); - icon.on('click', function () { + icon.on('clicked', function () { + console.log("Icon Clicked"); mainWindow.show(); });