fullscreen: adapt to new version

This commit is contained in:
bordun 2020-01-26 17:31:19 +01:00
parent 3e93ef8dc4
commit 9b0b8ce46c
3 changed files with 7 additions and 5 deletions

View file

@ -4,7 +4,7 @@ var screenfull = require('screenfull'),
var fullscreen
if (screenfull.enabled) {
if (screenfull.isEnabled) {
fullscreen = screenfull

View file

@ -16,9 +16,9 @@ var sidepanelData = [
{
label: locales('sidepanel_fs') + (ELECTRON_FULLSCREEN ? ' (F11)' : ''),
action:()=>{
if (fullscreen.enabled) fullscreen.toggle()
if (fullscreen.isEnabled) fullscreen.toggle()
},
class:'toggle fullscreenToggle' + (!fullscreen.enabled || ELECTRON_FULLSCREEN ? ' disabled' : '')
class:'toggle fullscreenToggle' + (!fullscreen.isEnabled || ELECTRON_FULLSCREEN ? ' disabled' : '')
}
]
@ -270,7 +270,7 @@ sidepanel.appendChild(html`<div id="editor"></div>`)
var fsToggle = DOM.get(sidepanel, '.fullscreenToggle')[0]
if (fullscreen.enabled) {
if (fullscreen.isEnabled) {
fullscreen.on('change', ()=>{
fsToggle.classList.toggle('on', fullscreen.isFullScreen)
})

View file

@ -16,7 +16,6 @@ module.exports = function(options={}) {
icon: path.resolve(__dirname + '/../assets/logo.png'),
backgroundColor: options.color || theme.backgroundColor,
type: options.type,
fullscreen: options.fullscreen,
useContentSize: true,
autoHideMenuBar: true,
webPreferences: {
@ -26,6 +25,9 @@ module.exports = function(options={}) {
})
window.once('ready-to-show', ()=>{
if (options.fullscreen) {
window.setFullScreen(true)
}
window.show()
})