remove actions expandVisibleColumns and shrinkVisibleColumns
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user