From 8f2d2cbe30c602699ca0c3a1e00a0d2a23a437da Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Fri, 23 Mar 2018 17:53:20 +0100 Subject: [PATCH] don't attempt to resize beyond min size when docking (fixes #308) --- terminus-core/src/services/docking.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/terminus-core/src/services/docking.service.ts b/terminus-core/src/services/docking.service.ts index b06a5bc2..63c0ccce 100644 --- a/terminus-core/src/services/docking.service.ts +++ b/terminus-core/src/services/docking.service.ts @@ -29,18 +29,19 @@ export class DockingService { let dockSide = this.config.store.appearance.dock let newBounds: Bounds = { x: 0, y: 0, width: 0, height: 0 } let fill = this.config.store.appearance.dockFill + let [minWidth, minHeight] = this.hostApp.getWindow().getMinimumSize() if (dockSide === 'off') { this.hostApp.setAlwaysOnTop(false) return } if (dockSide === 'left' || dockSide === 'right') { - newBounds.width = Math.round(fill * display.bounds.width) + newBounds.width = Math.max(minWidth, Math.round(fill * display.bounds.width)) newBounds.height = display.bounds.height } if (dockSide === 'top' || dockSide === 'bottom') { newBounds.width = display.bounds.width - newBounds.height = Math.round(fill * display.bounds.height) + newBounds.height = Math.max(minHeight, Math.round(fill * display.bounds.height)) } if (dockSide === 'right') { newBounds.x = display.bounds.x + display.bounds.width - newBounds.width