create PresetWidths stub

This commit is contained in:
Peter Fajdiga
2024-10-14 01:05:57 +02:00
parent 09b7b44e2c
commit ae0a4e142a
2 changed files with 4 additions and 5 deletions

View File

@@ -185,9 +185,6 @@ class Actions {
}
public readonly cyclePresetWidths = (cm: ClientManager, dm: DesktopManager, window: Window, column: Column, grid: Grid) => {
if (this.config.presetWidths === null) {
return;
}
const nextWidth = this.config.presetWidths.next(column.getWidth(), column.getMinWidth(), column.getMaxWidth());
column.setWidth(nextWidth, true);
}
@@ -411,7 +408,7 @@ namespace Actions {
export type Config = {
manualScrollStep: number;
manualResizeStep: number;
presetWidths: PresetWidths|null;
presetWidths: { next: (currentWidth: number, minWidth: number, maxWidth: number) => number };
columnResizer: ColumnResizer;
};

View File

@@ -9,7 +9,9 @@ class World {
constructor(config: Config) {
this.workspaceSignalManager = initWorkspaceSignalHandlers(this);
let presetWidths: PresetWidths|null = null;
let presetWidths = {
next: (currentWidth: number, minWidth: number, maxWidth: number) => currentWidth,
};
try {
presetWidths = new PresetWidths(config.presetWidths, config.gapsInnerHorizontal);
} catch (error: any) {