This commit is contained in:
mr. M
2024-12-17 00:11:44 +01:00
2 changed files with 14 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -33,7 +33,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
'activationMethod',
'zen.workspaces.scroll-modifier-key',
'ctrl',
this._expandWorkspacesStrip.bind(this)
);
XPCOMUtils.defineLazyPreferenceGetter(
this,
'naturalScroll',
'zen.workspaces.natural-scroll',
true
);
XPCOMUtils.defineLazyPreferenceGetter(
this,
@@ -169,7 +174,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
if (Math.abs(delta) < scrollThreshold) return;
// Determine scroll direction
const direction = delta > 0 ? -1 : 1;
let direction = delta > 0 ? -1 : 1;
if (this.naturalScroll) {
direction = delta > 0 ? 1 : -1;
}
// Workspace logic
const workspaces = (await this._workspaces()).workspaces;
@@ -254,6 +262,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
// Determine swipe direction based on cumulative delta
if (Math.abs(this._swipeState.cumulativeDelta) > 0.25) {
this._swipeState.direction = this._swipeState.cumulativeDelta > 0 ? 'right' : 'left';
if (this.naturalScroll){
this._swipeState.direction = this._swipeState.cumulativeDelta > 0 ? 'left' : 'right';
}
}
}