stack without shading
This commit is contained in:
@@ -6,6 +6,8 @@ class Column {
|
|||||||
private stacked: boolean;
|
private stacked: boolean;
|
||||||
private focusTaker: Window|null;
|
private focusTaker: Window|null;
|
||||||
private static readonly minWidth = 40;
|
private static readonly minWidth = 40;
|
||||||
|
private static readonly stackOffsetX = 10; // TODO: make configurable
|
||||||
|
private static readonly stackOffsetY = 30; // TODO: make configurable
|
||||||
|
|
||||||
constructor(grid: Grid, leftColumn: Column|null) {
|
constructor(grid: Grid, leftColumn: Column|null) {
|
||||||
this.gridX = 0;
|
this.gridX = 0;
|
||||||
@@ -232,29 +234,16 @@ class Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public arrangeStacked(x: number) {
|
public arrangeStacked(x: number) {
|
||||||
const expandedWindow = this.getFocusTaker();
|
const nWindows = this.windows.length();
|
||||||
let collapsedHeight;
|
const windowWidth = this.width - (nWindows - 1) * Column.stackOffsetX;
|
||||||
for (const window of this.windows.iterator()) {
|
const windowHeight = this.grid.desktop.tilingArea.height - (nWindows - 1) * Column.stackOffsetY;
|
||||||
if (window === expandedWindow) {
|
|
||||||
window.client.setShade(false);
|
|
||||||
} else {
|
|
||||||
window.client.setShade(true);
|
|
||||||
collapsedHeight = window.client.kwinClient.frameGeometry.height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const nCollapsed = this.getWindowCount() - 1;
|
let windowX = x;
|
||||||
const expandedHeight = this.grid.desktop.tilingArea.height - nCollapsed * (collapsedHeight! + this.grid.config.gapsInnerVertical);
|
let windowY = this.grid.desktop.tilingArea.y;
|
||||||
let y = this.grid.desktop.tilingArea.y;
|
|
||||||
for (const window of this.windows.iterator()) {
|
for (const window of this.windows.iterator()) {
|
||||||
if (window === expandedWindow) {
|
window.arrange(windowX, windowY, windowWidth, windowHeight);
|
||||||
window.arrange(x, y, this.width, expandedHeight);
|
windowX += Column.stackOffsetX;
|
||||||
y += expandedHeight;
|
windowY += Column.stackOffsetY;
|
||||||
} else {
|
|
||||||
window.arrange(x, y, this.width, window.height);
|
|
||||||
y += collapsedHeight!;
|
|
||||||
}
|
|
||||||
y += this.grid.config.gapsInnerVertical;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user