git ssb

2+

mixmix / ticktack



Tree: 59dd32b5a83df3b3e243a5bc34f33072e25a9701

Files: 59dd32b5a83df3b3e243a5bc34f33072e25a9701 / windowControls.js

832 bytesRaw
1const { h } = require('mutant')
2const { remote } = require('electron')
3const path = require('path')
4
5function windowControls () {
6 if (process.platform === 'darwin') return
7
8 const window = remote.getCurrentWindow()
9 const minimize = () => window.minimize()
10 const maximize = () => {
11 if (!window.isMaximized()) window.maximize()
12 else window.unmaximize()
13 }
14 const close = () => window.close()
15
16 return h('div.window-controls', [
17 h('img.min', {
18 src: assetPath('minimize.png'),
19 'ev-click': minimize
20 }),
21 h('img.max', {
22 src: assetPath('maximize.png'),
23 'ev-click': maximize
24 }),
25 h('img.close', {
26 src: assetPath('close.png'),
27 'ev-click': close
28 })
29 ])
30}
31
32module.exports = windowControls
33
34function assetPath (name) {
35 return path.join(__dirname, 'assets', name)
36}
37

Built with git-ssb-web