git ssb

1+

Daan Patchwork / patchwork



Commit 362cac1fe4ece2414ba2a455ab52e09dbd540562

Dep-eject api.fullscreen

Daan Wynen committed on 2/7/2021, 12:32:51 AM
Parent: a41b2de4bfaef67496e8f450f514033779a26328

Files changed

lib/depject/app/fullscreen.jsdeleted
lib/depject/index.jschanged
lib/main-window.jschanged
lib/fullscreen.jsadded
lib/depject/app/fullscreen.jsView
@@ -1,19 +1,0 @@
1-const nest = require('depnest')
2-const electron = require('electron')
3-const { Value } = require('mutant')
4-
5-exports.gives = nest('app.fullscreen')
6-
7-exports.create = function () {
8- return nest('app.fullscreen', function () {
9- const win = electron.remote.getCurrentWindow()
10- const isFullScreen = Value(win.isFullScreen())
11- win.on('enter-full-screen', function () {
12- isFullScreen.set(true)
13- })
14- win.on('leave-full-screen', function () {
15- isFullScreen.set(false)
16- })
17- return isFullScreen
18- })
19-}
lib/depject/index.jsView
@@ -11,9 +11,8 @@
1111 obs: require('./about/obs.js'),
1212 sync: require('./about/sync.js')
1313 },
1414 app: {
15- fullscreen: require('./app/fullscreen.js'),
1615 html: {
1716 'progress-notifier': require('./app/html/progress-notifier.js'),
1817 search: require('./app/html/search.js')
1918 },
lib/main-window.jsView
@@ -15,8 +15,9 @@
1515 const requireStyle = require('require-style')
1616 const ssbUri = require('ssb-uri')
1717 const pull = require('pull-stream')
1818 const moment = require('moment-timezone')
19+const fullscreen = require('./fullscreen.js')
1920
2021 const localTimezone = moment.tz.guess()
2122 moment.tz.setDefault(localTimezone)
2223
@@ -37,9 +38,8 @@
3738 'page.html.render': 'first',
3839 'app.html.search': 'first',
3940 'app.html.channels': 'first',
4041 'app.views': 'first',
41- 'app.fullscreen': 'first',
4242 'app.sync.externalHandler': 'first',
4343 'app.html.progressNotifier': 'first',
4444 'about.async.latestValues': 'first',
4545 'profile.sheet.edit': 'first',
@@ -193,9 +193,9 @@
193193 })
194194 )
195195
196196 const container = h(`MainWindow -${process.platform}`, {
197- classList: [when(api.app.fullscreen(), '-fullscreen')],
197+ classList: [when(fullscreen(), '-fullscreen')],
198198 'ev-dragover': preventDefault,
199199 'ev-drop': preventDefault,
200200 'ev-dragstart': preventDefaultUnlessImage
201201 }, [
lib/fullscreen.jsView
@@ -1,0 +1,14 @@
1+const electron = require('electron')
2+const { Value } = require('mutant')
3+
4+module.exports = function () {
5+ const win = electron.remote.getCurrentWindow()
6+ const isFullScreen = Value(win.isFullScreen())
7+ win.on('enter-full-screen', () => {
8+ isFullScreen.set(true)
9+ })
10+ win.on('leave-full-screen', () => {
11+ isFullScreen.set(false)
12+ })
13+ return isFullScreen
14+}

Built with git-ssb-web