console: tweaks

This commit is contained in:
bordun 2020-11-11 17:17:33 +01:00
parent 33581804ac
commit ff78df42b6
5 changed files with 10 additions and 7 deletions

View file

@ -175,7 +175,8 @@ var menuEntries = [
{
label: locales('console_enabled'),
class: ()=>{return 'toggle ' + (uiConsole.minimized ? 'off' : 'on')},
action: ()=>{return uiConsole.minimized ? uiConsole.restore() : uiConsole.minimize()}
action: ()=>{return uiConsole.minimized ? uiConsole.restore() : uiConsole.minimize()},
shortcut: 'mod + k'
},
{
separator: true

View file

@ -110,4 +110,4 @@ class UiConsole extends UiSidePanel {
}
module.exports = new UiConsole({selector: '#osc-console', size: 40})
module.exports = new UiConsole({selector: '#osc-console', minSize: 40, size: 200, minimized: true})

View file

@ -17,11 +17,13 @@ class UiSidePanel extends UiWidget {
this.cacheKey = 'ui.' + options.selector
this.minWidth = options.size === undefined ? 250 : options.size
this.width = cache.get(this.cacheKey + '.width') || options.size || 250
var size = cache.get(this.cacheKey + '.width') || 250
this.minWidth = options.minSize !== undefined ? options.minSize : options.minSize
this.width = size !== undefined ? size : (options.size !== undefined ? options.size : 250)
this.disabled = false
this.minimized = cache.get(this.cacheKey + '.minimized') || false
var minimized = cache.get(this.cacheKey + '.minimized')
this.minimized = minimized !== null ? minimized : (options.minimized || false)
this.init = false

View file

@ -44,7 +44,7 @@
<osc-modal-container></osc-modal-container>
</osc-panel-container>
<osc-panel-container class="bottom" id="osc-console">
<osc-panel-container class="bottom minimized" id="osc-console">
<div class="resize-handle bottom"></div>
<div class="toggle-button bottom"></div>
<osc-panel-inner class="bottom">

View file

@ -6,7 +6,7 @@ osc-workspace {
--color-stroke: var(--color-widget);
// optimize layout recalc
position: absolute;
position: fixed;
top:0;
left:0;
right:0;