Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions package/contents/ui/config.ui
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_wrapColumns">
<property name="text">
<string>Wrap column navigation at edges</string>
</property>
<property name="toolTip">
<string>Moving focus or a column past the last one jumps back to the first, and vice versa</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_resizeNeighborColumn">
<property name="text">
Expand Down
1 change: 1 addition & 0 deletions src/lib/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ interface Config {
floatingKeepAbove: boolean;
windowRules: string;
tiledDesktops: string;
wrapColumns: boolean;
}
6 changes: 6 additions & 0 deletions src/lib/config/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,10 @@ const configDef = [
type: "String",
default: ".*",
},

{
name: "wrapColumns",
type: "Bool",
default: false,
},
];
12 changes: 10 additions & 2 deletions src/lib/layout/Grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,19 @@ class Grid {
}

public getLeftColumn(column: Column) {
return this.columns.getPrev(column);
const prev = this.columns.getPrev(column);
if (prev === null && this.config.wrapColumns) {
return this.columns.getLast();
}
return prev;
}

public getRightColumn(column: Column) {
return this.columns.getNext(column);
const next = this.columns.getNext(column);
if (next === null && this.config.wrapColumns) {
return this.columns.getFirst();
}
return next;
}

public getFirstColumn() {
Expand Down
1 change: 1 addition & 0 deletions src/lib/layout/LayoutConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ interface LayoutConfig {
tiledKeepBelow: boolean;
maximizedKeepAbove: boolean;
untileOnDrag: boolean;
wrapColumns: boolean;
}
1 change: 1 addition & 0 deletions src/lib/world/World.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class World {
tiledKeepBelow: config.tiledKeepBelow,
maximizedKeepAbove: config.floatingKeepAbove,
untileOnDrag: config.untileOnDrag,
wrapColumns: config.wrapColumns,
};

this.desktopManager = new DesktopManager(
Expand Down