From c7282e2b2d0cc3c6231aafb2e7cc0f0971d24a83 Mon Sep 17 00:00:00 2001 From: Peter Fajdiga Date: Mon, 30 Jan 2023 00:21:24 +0100 Subject: [PATCH] add `Grid.clientArea` --- src/layout/Grid.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/layout/Grid.ts b/src/layout/Grid.ts index c36adce..15d38aa 100644 --- a/src/layout/Grid.ts +++ b/src/layout/Grid.ts @@ -5,6 +5,7 @@ class Grid { private scrollX: number; private width: number; private userResize: boolean; // is any part of the grid being resized by the user + public clientArea: QRect; public tilingArea: QRect; public desktop: number; private userResizeFinishedDelayer: Delayer; @@ -26,11 +27,13 @@ class Grid { } updateArea() { - this.tilingArea = workspace.clientArea(workspace.PlacementArea, 0, this.desktop); // TODO: multi-screen support - this.tilingArea.x += GAPS_OUTER.left; - this.tilingArea.y += GAPS_OUTER.top; - this.tilingArea.width -= GAPS_OUTER.left + GAPS_OUTER.right; - this.tilingArea.height -= GAPS_OUTER.top + GAPS_OUTER.bottom; + this.clientArea = workspace.clientArea(workspace.PlacementArea, 0, this.desktop); // TODO: multi-screen support + this.tilingArea = Qt.rect( + this.clientArea.x + GAPS_OUTER.left, + this.clientArea.y + GAPS_OUTER.top, + this.clientArea.width - GAPS_OUTER.left - GAPS_OUTER.right, + this.clientArea.height - GAPS_OUTER.top - GAPS_OUTER.bottom, + ) for (const column of this.columns.iterator()) { column.resizeWindows(); }