diff --git a/desktop/main.js b/desktop/main.js index 9835437..5201349 100644 --- a/desktop/main.js +++ b/desktop/main.js @@ -12,7 +12,7 @@ app.on('ready', () => { width: 780, height: 392, minWidth: 380, - minHeight: 380, + minHeight: 360, backgroundColor: '#000', icon: path.join(__dirname, { darwin: 'icon.icns', linux: 'icon.png', win32: 'icon.ico' }[process.platform] || 'icon.ico'), resizable: true, diff --git a/desktop/sources/links/main.css b/desktop/sources/links/main.css index cc17c46..350ac06 100644 --- a/desktop/sources/links/main.css +++ b/desktop/sources/links/main.css @@ -4,12 +4,13 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_regular #ronin { height: calc(100vh - 60px); width:calc(100vw - 60px); -webkit-app-region: drag; padding: 30px;overflow: hidden; } #ronin #wrapper { overflow: hidden; position: relative; } -#ronin #wrapper #commander { z-index: 9000; position: relative; width: 300px; height: calc(100vh - 60px); border-right: 1px solid #333; -webkit-app-region: no-drag; padding-right: 30px; transition: margin-left 250ms;} +#ronin #wrapper #commander { z-index: 9000;position: relative;width: 310px;height: calc(100vh - 60px);-webkit-app-region: no-drag;padding-right: 30px;transition: margin-left 250ms;} #ronin #wrapper #commander textarea { background: none; width: 100%; height: calc(100vh - 80px); resize: none; font-size: 12px;line-height: 15px; padding-right: 15px} #ronin #wrapper #commander div#status { position: absolute; bottom: 0px; } #ronin.hidden #wrapper #commander { margin-left:-331px; } #ronin canvas#surface,#ronin canvas#guide { position: absolute; top:0px; -webkit-user-select: none;-webkit-app-region: no-drag; background-image: url("data:image/svg+xml;utf8,"); background-size: 10px 10px; background-position: -4px -4px; width:100%; height:100%; left:340px; transition: left 250ms} #ronin canvas#guide { background:none; } +#ronin canvas#surface { border-radius: 2px } #ronin.hidden canvas#surface, #ronin.hidden canvas#guide { left:0px; } \ No newline at end of file diff --git a/desktop/sources/links/theme.css b/desktop/sources/links/theme.css index bd8b6b7..f82f7b7 100644 --- a/desktop/sources/links/theme.css +++ b/desktop/sources/links/theme.css @@ -1,5 +1,5 @@ body { background:var(--background); } #ronin #wrapper { background: var(--background); } -#ronin #wrapper #commander { background:var(--background);border-right-color: var(--f_low) } +#ronin #wrapper #commander { background:var(--background); } #ronin #wrapper #commander textarea { color:var(--f_high); } #ronin #wrapper #commander div#status { color:var(--f_med); } \ No newline at end of file diff --git a/desktop/sources/scripts/commander.js b/desktop/sources/scripts/commander.js index 8169562..ccf9f1f 100644 --- a/desktop/sources/scripts/commander.js +++ b/desktop/sources/scripts/commander.js @@ -4,6 +4,7 @@ function Commander (ronin) { this._input = document.createElement('textarea') this._status = document.createElement('div') this._status.id = 'status' + this.isVisible = true this.install = function (host) { this.el.appendChild(this._input) @@ -22,7 +23,6 @@ function Commander (ronin) { this.run = (txt = this._input.value) => { if (txt.indexOf('$') > -1) { ronin.log('Present: $'); return } - ronin.surface.maximize() const inter = new Lisp(txt, ronin.library) inter.toPixels() ronin.always && requestAnimationFrame(() => this.run(txt)) @@ -144,19 +144,19 @@ function Commander (ronin) { // Display this.show = function () { - if (ronin.el.className !== '') { - ronin.el.className = '' - } + if (this.isVisible === true) { return } + ronin.el.className = '' + this.isVisible = true } this.hide = function () { - if (ronin.el.className !== 'hidden') { - ronin.el.className = 'hidden' - } + if (this.isVisible !== true) { return } + ronin.el.className = 'hidden' + this.isVisible = false } this.toggle = function () { - if (ronin.el.className === 'hidden') { + if (this.isVisible !== true) { this.show() } else { this.hide() diff --git a/desktop/sources/scripts/ronin.js b/desktop/sources/scripts/ronin.js index 3bcb7e9..0883f22 100644 --- a/desktop/sources/scripts/ronin.js +++ b/desktop/sources/scripts/ronin.js @@ -61,7 +61,7 @@ function Ronin () { } this.animate = (b = true) => { - if(this.always === b){ return } + if (this.always === b) { return } this.always = b this.commander.run() } diff --git a/desktop/sources/scripts/surface.js b/desktop/sources/scripts/surface.js index efaa8a1..d1143e0 100644 --- a/desktop/sources/scripts/surface.js +++ b/desktop/sources/scripts/surface.js @@ -150,6 +150,7 @@ function Surface (ronin) { } this.resize = function (size, fit = false) { + console.log('Surface', `Resize: ${size.w}x${size.h}`) this.el.width = size.w this.el.height = size.h this.el.style.width = size.w + 'px' @@ -165,7 +166,7 @@ function Surface (ronin) { this.fitWindow = function (size) { const win = require('electron').remote.getCurrentWindow() - const pad = { w: 60, h: 60 } + const pad = { w: ronin.commander.isVisible === true ? 400 : 60, h: 60 } win.setSize(size.w + pad.w, size.h + pad.h, false) }