launcher: auto size, fixed header, growing terminal + autoscroll if scrolled to bottom (pr #172)
This commit is contained in:
parent
e71b487bc2
commit
7352a99397
3 changed files with 23 additions and 22 deletions
|
|
@ -194,16 +194,18 @@ $(document).ready(()=>{
|
|||
})
|
||||
|
||||
// Fake console
|
||||
var terminal = $(`<div class="terminal"></div>`).appendTo('#launcher').hide()
|
||||
var terminal = $(`<div class="terminal"></div>`).appendTo(form).hide()
|
||||
|
||||
ipcRenderer.on('stdout', function(e, msg){
|
||||
var scroll = document.body.offsetHeight + document.body.scrollTop == document.body.scrollHeight
|
||||
terminal.append(`<div class="log">${msg}</div>`)
|
||||
terminal.scrollTop(terminal.prop('scrollHeight'))
|
||||
if (scroll) document.body.scrollTop = document.body.offsetHeight + document.body.scrollHeight
|
||||
})
|
||||
|
||||
ipcRenderer.on('stderr', function(e, msg){
|
||||
var scroll = document.body.offsetHeight + document.body.scrollTop == document.body.scrollHeight
|
||||
terminal.append(`<div class="error">${msg}</div>`)
|
||||
terminal.scrollTop(terminal.prop('scrollHeight'))
|
||||
if (scroll) document.body.scrollTop = document.body.offsetHeight + document.body.scrollHeight
|
||||
})
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ if (settings.cli) {
|
|||
launcher
|
||||
|
||||
app.on('ready',function(){
|
||||
launcher = require('./electron-window')({address:address, shortcuts:false, width:680, height:655, node:true, color:'#283143'})
|
||||
launcher = require('./electron-window')({address:address, shortcuts:true, width:680, height:(100 + 8*3 + 29 * Object.keys(settings.options).filter(x => settings.options[x].launcher !== false).length), node:true, color:'#283143'})
|
||||
})
|
||||
|
||||
if (process.log) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue