Commit 88825be190e82aaf49cccf3e564aa728b1a3a9c6
align top bar with content in fullscreen on darwin
Oleg SKLYANCHUK committed on 1/15/2018, 1:30:34 PMParent: 1b12a6e637ed46e490143b6969204eed33886975
Files changed
main-window.js | changed |
modules/app/fullscreen.js | added |
styles/dark/main-window.mcss | changed |
styles/light/main-window.mcss | changed |
main-window.js | ||
---|---|---|
@@ -33,8 +33,9 @@ | ||
33 | 33 | 'page.html.render': 'first', |
34 | 34 | 'app.html.search': 'first', |
35 | 35 | 'app.html.channels': 'first', |
36 | 36 | 'app.views': 'first', |
37 | + 'app.fullscreen': 'first', | |
37 | 38 | 'app.sync.externalHandler': 'first', |
38 | 39 | 'app.html.progressNotifier': 'first', |
39 | 40 | 'profile.sheet.edit': 'first', |
40 | 41 | 'profile.html.preview': 'first', |
@@ -89,9 +90,11 @@ | ||
89 | 90 | }) |
90 | 91 | }) |
91 | 92 | ) |
92 | 93 | |
93 | - var container = h(`MainWindow -${process.platform}`, [ | |
94 | + var container = h(`MainWindow -${process.platform}`, { | |
95 | + classList: [ when(api.app.fullscreen(), '-fullscreen') ] | |
96 | + }, [ | |
94 | 97 | h('div.top', [ |
95 | 98 | h('span.history', [ |
96 | 99 | h('a', { |
97 | 100 | 'ev-click': views.goBack, |
modules/app/fullscreen.js | ||
---|---|---|
@@ -1,0 +1,18 @@ | ||
1 | +var nest = require('depnest') | |
2 | +var { computed, Value } = require('mutant') | |
3 | + | |
4 | +exports.gives = nest('app.fullscreen') | |
5 | + | |
6 | +exports.create = function () { | |
7 | + return nest('app.fullscreen', function () { | |
8 | + var win = electron.remote.getCurrentWindow() | |
9 | + var isFullScreen = Value(win.isFullScreen()) | |
10 | + win.on('enter-full-screen', function () { | |
11 | + isFullScreen.set(true) | |
12 | + }) | |
13 | + win.on('leave-full-screen', function () { | |
14 | + isFullScreen.set(false) | |
15 | + }) | |
16 | + return isFullScreen | |
17 | + }); | |
18 | +} |
Built with git-ssb-web