launcher: make it possible to set vsync from launcher by telling if the app must be restarted

This commit is contained in:
jean-emmanuel 2016-12-09 19:04:37 +01:00
parent 56ec3bc7d5
commit 9bdeb3a712
5 changed files with 17 additions and 7 deletions

View file

@ -81,6 +81,14 @@ $(document).ready(()=>{
argv[i] = v
}
if (option.restart && v!=value && !wrapper.hasClass('restart')) {
wrapper.addClass('restart')
wrapper.append(`<div class="restart-msg">The app must be restarted for this change to take effect.</div>`)
} else if (option.restart && wrapper.hasClass('restart')) {
wrapper.removeClass('restart')
wrapper.find('.restart-msg').remove()
}
if (!stop) $('input').not(input).trigger('change',true)
})

View file

@ -52,7 +52,7 @@ if (cli) {
launcher
app.on('ready',function(){
launcher = require('./electron-window')({address:address, shortcuts:false, width:600, height:452})
launcher = require('./electron-window')({address:address, shortcuts:false, width:600, height:482})
})
ipcMain.on('start',function(e, options){

View file

@ -49,7 +49,7 @@ var options = {
true : 'examples can\'t be listed if --load is set'
}
},
'disable-vsync':{type:'boolean',describe:'disable gui\'s vertical synchronization', launcher: false}
'disable-vsync':{type:'boolean',describe:'disable gui\'s vertical synchronization', restart: true}
}

View file

@ -9,8 +9,6 @@ Prebuilt binaries for Linux, Windows and OS X can be found on the [release](http
Below are the available command-line switches. Note that when running without any command-line switch (ie from a file browser), a launcher window will spawn to help setting them.
Note: `--disable-vsync` can only be enabled from a terminal.
```
Options:

View file

@ -216,20 +216,24 @@ i {
color:var(--color-accent);
}
}
.error-msg {
.error-msg, .restart-msg {
transition: height .25s;
height: 0rem;
white-space:normal;
padding: 0 4rem;
margin-left:1rem;
}
&.error {
&.error, &.restart {
.error-msg {
height: 28rem;
line-height: 28rem;
background: rgba(red,0.25)
}
.restart-msg {
height: 28rem;
line-height: 28rem;
background: rgba(yellow,0.25)
}
}
}
.title {