git ssb

2+

mixmix / ticktack



Commit 140bd2aa4c9baa0075ccea378b2376a4c90cf8fc

disable window controls for mac

mix irving committed on 2/13/2018, 11:08:49 PM
Parent: 95a724de44efbe0bdd68899252a4f76f3f4c2de4

Files changed

app/html/header.jschanged
app/html/header.jsView
@@ -20,35 +20,14 @@
2020 })
2121
2222 if (loc().page === 'splash') return
2323
24- const window = remote.getCurrentWindow()
25- const minimize = () => window.minimize()
26- const maximize = () => {
27- if (!window.isMaximized()) window.maximize()
28- else window.unmaximize()
29- }
30- const close = () => window.close()
31-
3224 const isSettings = computed(loc, loc => SETTINGS_PAGES.includes(loc.page))
3325 const isAddressBook = computed(loc, loc => loc.page === 'addressBook')
3426 const isFeed = computed([isAddressBook, isSettings], (p, s) => !p && !s)
3527
3628 return h('Header', [
37- h('div.window-controls', [
38- h('img.min', {
39- src: assetPath('minimize.png'),
40- 'ev-click': minimize
41- }),
42- h('img.max', {
43- src: assetPath('maximize.png'),
44- 'ev-click': maximize
45- }),
46- h('img.close', {
47- src: assetPath('close.png'),
48- 'ev-click': close
49- })
50- ]),
29 + windowControls(),
5130 h('nav', [
5231 h('img.feed', {
5332 src: when(isFeed, assetPath('feed_on.png'), assetPath('feed.png')),
5433 'ev-click': () => push({page: 'blogIndex'})
@@ -63,8 +42,35 @@
6342 })
6443 ])
6544 ])
6645 })
46 +
47 + function windowControls () {
48 + if (process.platform === 'darwin') return
49 +
50 + const window = remote.getCurrentWindow()
51 + const minimize = () => window.minimize()
52 + const maximize = () => {
53 + if (!window.isMaximized()) window.maximize()
54 + else window.unmaximize()
55 + }
56 + const close = () => window.close()
57 +
58 + return h('div.window-controls', [
59 + h('img.min', {
60 + src: assetPath('minimize.png'),
61 + 'ev-click': minimize
62 + }),
63 + h('img.max', {
64 + src: assetPath('maximize.png'),
65 + 'ev-click': maximize
66 + }),
67 + h('img.close', {
68 + src: assetPath('close.png'),
69 + 'ev-click': close
70 + })
71 + ])
72 + }
6773 }
6874
6975 function assetPath (name) {
7076 return path.join(__dirname, '../../assets', name)

Built with git-ssb-web