main: add --fullscreen option (issue #164)
This commit is contained in:
parent
56707f279c
commit
2a709a2328
7 changed files with 30 additions and 12 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
## next
|
||||
|
||||
- main
|
||||
- add `--fullscreen` switch (default gui only, bypasses the sidepanel fullscreen button)
|
||||
- widgets
|
||||
- knob: big knobs design tweaks
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ module.exports = function(options={}) {
|
|||
title: options.title || settings.read('appName'),
|
||||
icon: path.resolve(__dirname + '/../browser/logo.png'),
|
||||
backgroundColor: options.color || bgColor,
|
||||
type:options.type,
|
||||
type: options.type,
|
||||
fullscreen: options.fullscreen,
|
||||
webPreferences: {
|
||||
nodeIntegration: !!options.node
|
||||
}
|
||||
|
|
@ -37,6 +38,16 @@ module.exports = function(options={}) {
|
|||
}
|
||||
})
|
||||
|
||||
if (options.fullscreen) {
|
||||
window.webContents.on('dom-ready', ()=>{
|
||||
window.webContents.executeJavaScript(`
|
||||
window.ELECTRON_FULLSCREEN = true
|
||||
`)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
window.on('closed', function() {
|
||||
window = null
|
||||
})
|
||||
|
|
|
|||
|
|
@ -35,12 +35,16 @@ var start = function(readyApp) {
|
|||
var app = require('./electron-app')
|
||||
var address = typeof settings.read('guiOnly')=='string'? 'http://' + settings.read('guiOnly') : settings.read('appAddresses')[0]
|
||||
address += settings.read('urlOptions')
|
||||
if (app.isReady()) {
|
||||
var win = require('./electron-window')({address:address, shortcuts:true})
|
||||
|
||||
var launch = ()=>{
|
||||
var win = require('./electron-window')({address:address, shortcuts:true, fullscreen: settings.read('fullScreen')})
|
||||
return win
|
||||
}
|
||||
if (app.isReady()) {
|
||||
return launch()
|
||||
} else {
|
||||
app.on('ready',function(){
|
||||
var win = require('./electron-window')({address:address, shortcuts:true})
|
||||
launch()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -62,7 +66,7 @@ if (settings.cli) {
|
|||
launcher
|
||||
|
||||
app.on('ready',function(){
|
||||
launcher = require('./electron-window')({address:address, shortcuts:false, width:680, height:626, node:true, color:'#283143'})
|
||||
launcher = require('./electron-window')({address:address, shortcuts:false, width:680, height:655, node:true, color:'#283143'})
|
||||
})
|
||||
|
||||
if (process.log) {
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ var options = {
|
|||
true : 'blank session can\'t be started in read-only mode'
|
||||
}
|
||||
},
|
||||
'instance-name':{type:'string',describe:'used to differenciate multiple instances in a zeroconf network'
|
||||
},
|
||||
'instance-name':{type:'string',describe:'used to differenciate multiple instances in a zeroconf network'},
|
||||
'fullscreen':{type:'boolean', describe:'launch the default client gui in fullscreen mode (F11 to exit)'}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -167,6 +167,7 @@ var makeDefaultConfig = function(argv){
|
|||
sessionFile: argv.l || false,
|
||||
newSession: argv.b || false,
|
||||
customModule: argv.c || false,
|
||||
fullScreen: argv['fullscreen'] || false,
|
||||
noGui: argv.n || false,
|
||||
guiOnly: typeof argv.g == 'string' ? argv.g.length ? argv.g : true : false,
|
||||
urlOptions: argv['url-options'] ? '?' + argv['url-options'].join('&') : '',
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ Below are the available command-line options. Note that when running without any
|
|||
| |`--disable-gpu` | disable hardware acceleration |
|
||||
| |`--read-only` | disable session editing and session history changes |
|
||||
| |`--instance-name` | used to differenciate multiple instances in a zeroconf network |
|
||||
| |`--fullscreen` | launch the default client gui in fullscreen mode (F11 to exit) |
|
||||
|
||||
Command-line only :
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, (s,k,v)=>{
|
|||
ARGV[k]=v
|
||||
})
|
||||
|
||||
window.ELECTRON_FULLSCREEN = window.ELECTRON_FULLSCREEN || false
|
||||
|
||||
window.PACKAGE = require('../../../../app/package.json')
|
||||
document.title = PACKAGE.productName + ' v' + PACKAGE.version
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ var sidepanelData = [
|
|||
{
|
||||
actions: [
|
||||
{
|
||||
title:'Fullscreen',
|
||||
title:'Fullscreen' + (ELECTRON_FULLSCREEN ? ' (F11)' : ''),
|
||||
action:()=>{
|
||||
if (fullscreen.enabled) fullscreen.toggle()
|
||||
},
|
||||
class:'fullscreenToggle'
|
||||
class:'fullscreenToggle' + (!fullscreen.enabled || ELECTRON_FULLSCREEN ? ' disabled' : '')
|
||||
}
|
||||
|
||||
]
|
||||
|
|
@ -152,11 +152,8 @@ if (fullscreen.enabled) {
|
|||
fullscreen.on('change', ()=>{
|
||||
fsToggle.classList.toggle('on', fullscreen.isFullScreen)
|
||||
})
|
||||
} else {
|
||||
fsToggle.classList.add('disabled')
|
||||
}
|
||||
|
||||
|
||||
// open / close / toggle
|
||||
|
||||
var sidepaneLock = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue