diff --git a/terminus-core/src/configDefaults.yaml b/terminus-core/src/configDefaults.yaml index dbffadfd..1982e037 100644 --- a/terminus-core/src/configDefaults.yaml +++ b/terminus-core/src/configDefaults.yaml @@ -2,6 +2,7 @@ appearance: dock: off dockScreen: current dockFill: 0.5 + dockSpace: 1 dockHideOnBlur: false dockAlwaysOnTop: true flexTabs: false diff --git a/terminus-core/src/services/docking.service.ts b/terminus-core/src/services/docking.service.ts index b83e5876..b42eadee 100644 --- a/terminus-core/src/services/docking.service.ts +++ b/terminus-core/src/services/docking.service.ts @@ -34,25 +34,30 @@ export class DockingService { const newBounds: Bounds = { x: 0, y: 0, width: 0, height: 0 } const fill = this.config.store.appearance.dockFill <= 1 ? this.config.store.appearance.dockFill : 1 + const space = this.config.store.appearance.dockSpace <= 1 ? this.config.store.appearance.dockSpace : 1 const [minWidth, minHeight] = this.hostApp.getWindow().getMinimumSize() if (dockSide === 'left' || dockSide === 'right') { newBounds.width = Math.max(minWidth, Math.round(fill * display.bounds.width)) - newBounds.height = display.bounds.height + newBounds.height = Math.round(display.bounds.height * space) } if (dockSide === 'top' || dockSide === 'bottom') { - newBounds.width = display.bounds.width + newBounds.width = Math.round(display.bounds.width * space) newBounds.height = Math.max(minHeight, Math.round(fill * display.bounds.height)) } if (dockSide === 'right') { newBounds.x = display.bounds.x + display.bounds.width - newBounds.width - } else { + } else if (dockSide === 'left') { newBounds.x = display.bounds.x + } else { + newBounds.x = display.bounds.x + Math.round(display.bounds.width / 2 * (1 - space)) } if (dockSide === 'bottom') { newBounds.y = display.bounds.y + display.bounds.height - newBounds.height - } else { + } else if (dockSide === 'top') { newBounds.y = display.bounds.y + } else { + newBounds.y = display.bounds.y + Math.round(display.bounds.height / 2 * (1 - space)) } const alwaysOnTop = this.config.store.appearance.dockAlwaysOnTop diff --git a/terminus-settings/src/components/settingsTab.component.pug b/terminus-settings/src/components/settingsTab.component.pug index efa125fe..ecb6a4b7 100644 --- a/terminus-settings/src/components/settingsTab.component.pug +++ b/terminus-settings/src/components/settingsTab.component.pug @@ -220,7 +220,7 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab') ) | Bottom - .form-line(*ngIf='config.store.appearance.dock != "off"') + .ml-5.form-line(*ngIf='config.store.appearance.dock != "off"') .header .title Display on .description Snaps the window to a side of the screen @@ -245,7 +245,7 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab') ) | {{screen.name}} - .form-line(*ngIf='config.store.appearance.dock != "off"') + .ml-5.form-line(*ngIf='config.store.appearance.dock != "off"') .header .title Dock always on top .description Keep docked terminal always on top @@ -254,7 +254,7 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab') (ngModelChange)='saveConfiguration(); docking.dock()', ) - .form-line(*ngIf='config.store.appearance.dock != "off"') + .ml-5.form-line(*ngIf='config.store.appearance.dock != "off"') .header .title Docked terminal size input( @@ -266,7 +266,19 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab') step='0.01' ) - .form-line(*ngIf='config.store.appearance.dock != "off"') + .ml-5.form-line(*ngIf='config.store.appearance.dock != "off"') + .header + .title Docked terminal space + input( + type='range', + [(ngModel)]='config.store.appearance.dockSpace', + (mouseup)='saveConfiguration(); docking.dock()', + min='0.2', + max='1', + step='0.01' + ) + + .ml-5.form-line(*ngIf='config.store.appearance.dock != "off"') .header .title Hide dock on blur .description Hides the docked terminal when you click away.