From dec4281bb971c5fb85e5811c49b6efd1787975d6 Mon Sep 17 00:00:00 2001 From: Peter Fajdiga Date: Wed, 5 Jul 2023 11:52:11 +0200 Subject: [PATCH] remove actions expandVisibleColumns and shrinkVisibleColumns --- src/actions.ts | 12 ------------ src/keyBindings/definition.ts | 14 -------------- src/layout/Grid.ts | 29 ----------------------------- 3 files changed, 55 deletions(-) diff --git a/src/actions.ts b/src/actions.ts index 629b585..c6e8e44 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -189,18 +189,6 @@ function initActions(world: World) { }); }, - expandVisibleColumns: () => { - const grid = world.getCurrentGrid(); - grid.rescaleVisibleColumns(true, true); - grid.arrange(); - }, - - shrinkVisibleColumns: () => { - const grid = world.getCurrentGrid(); - grid.rescaleVisibleColumns(false, false); - grid.arrange(); - }, - gridScrollLeft: () => { gridScroll(world, -world.config.manualScrollStep); }, diff --git a/src/keyBindings/definition.ts b/src/keyBindings/definition.ts index e49baf7..49b6b4b 100644 --- a/src/keyBindings/definition.ts +++ b/src/keyBindings/definition.ts @@ -129,20 +129,6 @@ const keyBindings: KeyBinding[] = [ "defaultKeySequence": "Meta+Ctrl+-", "action": "columnWidthDecrease", }, - { - "name": "expand-visible-columns", - "description": "Expand fully visible columns", - "comment": "Expands fully visible columns to fill the screen", - "defaultKeySequence": "Meta+Alt++", - "action": "expandVisibleColumns", - }, - { - "name": "shrink-visible-columns", - "description": "Shrink visible columns", - "comment": "Shrinks fully and partially visible columns, making them fully visible and filling the screen", - "defaultKeySequence": "Meta+Alt+-", - "action": "shrinkVisibleColumns", - }, { "name": "grid-scroll-focused", "description": "Center focused window", diff --git a/src/layout/Grid.ts b/src/layout/Grid.ts index 7a0408c..ab1d211 100644 --- a/src/layout/Grid.ts +++ b/src/layout/Grid.ts @@ -157,35 +157,6 @@ class Grid { return this.getNextColumn(rightVisible); } - rescaleVisibleColumns(fullyVisible: boolean, allowScaleUp: boolean) { - const startColumn = this.getLeftmostVisibleColumn(fullyVisible); - const endColumn = this.getRightmostVisibleColumn(fullyVisible); - if (startColumn === null || endColumn === null) { - return; - } - - const startX = startColumn.getLeft(); - const endX = endColumn.getRight(); - const width = endX - startX; - let remainingWidth = this.tilingArea.width - 2 * this.world.config.overscroll; - const scaleRatio = remainingWidth / width; - if (!allowScaleUp && scaleRatio >= 1.0) { - return; - } - - for (const column of this.columns.iteratorFrom(startColumn)) { - if (column !== endColumn) { - column.setWidth(Math.round(column.width * scaleRatio), true); - remainingWidth -= column.width + this.world.config.gapsInnerHorizontal; - } else { - column.setWidth(remainingWidth, true); - break; - } - } - - this.setScroll(startX - this.world.config.overscroll, false); - } - increaseColumnWidth(column: Column) { this.scrollToColumn(column); if (this.width < this.tilingArea.width) {