git ssb

10+

Matt McKegg / patchwork



Commit 88825be190e82aaf49cccf3e564aa728b1a3a9c6

align top bar with content in fullscreen on darwin

Oleg SKLYANCHUK committed on 1/15/2018, 1:30:34 PM
Parent: 1b12a6e637ed46e490143b6969204eed33886975

Files changed

main-window.jschanged
modules/app/fullscreen.jsadded
styles/dark/main-window.mcsschanged
styles/light/main-window.mcsschanged
main-window.jsView
@@ -33,8 +33,9 @@
3333 'page.html.render': 'first',
3434 'app.html.search': 'first',
3535 'app.html.channels': 'first',
3636 'app.views': 'first',
37+ 'app.fullscreen': 'first',
3738 'app.sync.externalHandler': 'first',
3839 'app.html.progressNotifier': 'first',
3940 'profile.sheet.edit': 'first',
4041 'profile.html.preview': 'first',
@@ -89,9 +90,11 @@
8990 })
9091 })
9192 )
9293
93- var container = h(`MainWindow -${process.platform}`, [
94+ var container = h(`MainWindow -${process.platform}`, {
95+ classList: [ when(api.app.fullscreen(), '-fullscreen') ]
96+ }, [
9497 h('div.top', [
9598 h('span.history', [
9699 h('a', {
97100 'ev-click': views.goBack,
modules/app/fullscreen.jsView
@@ -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+}
styles/dark/main-window.mcssView
@@ -2,11 +2,18 @@
22 display: flex
33 flex: 1
44 flex-direction: column
55
6+ :not(.-fullscreen) {
7+ -darwin {
8+ div.top {
9+ padding-left: 70px
10+ }
11+ }
12+ }
13+
614 -darwin {
715 div.top {
8- padding-left: 70px
916 span.appTitle {
1017 span.title {
1118 visibility: visible
1219 }
styles/light/main-window.mcssView
@@ -2,11 +2,18 @@
22 flex: 1
33 display: flex
44 flex-direction: column
55
6+ :not(.-fullscreen) {
7+ -darwin {
8+ div.top {
9+ padding-left: 70px
10+ }
11+ }
12+ }
13+
614 -darwin {
715 div.top {
8- padding-left: 70px
916 span.appTitle {
1017 span.title {
1118 visibility: visible
1219 }

Built with git-ssb-web