Commit 140bd2aa4c9baa0075ccea378b2376a4c90cf8fc
disable window controls for mac
mix irving committed on 2/13/2018, 11:08:49 PMParent: 95a724de44efbe0bdd68899252a4f76f3f4c2de4
Files changed
app/html/header.js | changed |
app/html/header.js | ||
---|---|---|
@@ -20,35 +20,14 @@ | ||
20 | 20 … | }) |
21 | 21 … | |
22 | 22 … | if (loc().page === 'splash') return |
23 | 23 … | |
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 | - | |
32 | 24 … | const isSettings = computed(loc, loc => SETTINGS_PAGES.includes(loc.page)) |
33 | 25 … | const isAddressBook = computed(loc, loc => loc.page === 'addressBook') |
34 | 26 … | const isFeed = computed([isAddressBook, isSettings], (p, s) => !p && !s) |
35 | 27 … | |
36 | 28 … | 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(), | |
51 | 30 … | h('nav', [ |
52 | 31 … | h('img.feed', { |
53 | 32 … | src: when(isFeed, assetPath('feed_on.png'), assetPath('feed.png')), |
54 | 33 … | 'ev-click': () => push({page: 'blogIndex'}) |
@@ -63,8 +42,35 @@ | ||
63 | 42 … | }) |
64 | 43 … | ]) |
65 | 44 … | ]) |
66 | 45 … | }) |
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 … | + } | |
67 | 73 … | } |
68 | 74 … | |
69 | 75 … | function assetPath (name) { |
70 | 76 … | return path.join(__dirname, '../../assets', name) |
Built with git-ssb-web