mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 13:03:42 +01:00
remove swipeToNavigate (#57629)
This commit is contained in:
@@ -13,7 +13,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { IWindowSettings, MenuBarVisibility, IWindowConfiguration, ReadyState, IRunActionInWindowRequest, getTitleBarStyle } from 'vs/platform/windows/common/windows';
|
||||
import { IWindowSettings, MenuBarVisibility, IWindowConfiguration, ReadyState, getTitleBarStyle } from 'vs/platform/windows/common/windows';
|
||||
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||
import { ICodeWindow, IWindowState, WindowMode } from 'vs/platform/windows/electron-main/windows';
|
||||
@@ -40,14 +40,6 @@ export const defaultWindowState = function (mode = WindowMode.Normal): IWindowSt
|
||||
};
|
||||
};
|
||||
|
||||
interface IWorkbenchEditorConfiguration {
|
||||
workbench: {
|
||||
editor: {
|
||||
swipeToNavigate: boolean
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
interface ITouchBarSegment extends Electron.SegmentedControlSegment {
|
||||
id: string;
|
||||
}
|
||||
@@ -460,30 +452,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
this.currentMenuBarVisibility = newMenuBarVisibility;
|
||||
this.setMenuBarVisibility(newMenuBarVisibility);
|
||||
}
|
||||
|
||||
// Swipe command support (macOS)
|
||||
if (isMacintosh) {
|
||||
const config = this.configurationService.getValue<IWorkbenchEditorConfiguration>();
|
||||
if (config && config.workbench && config.workbench.editor && config.workbench.editor.swipeToNavigate) {
|
||||
this.registerSwipeListener();
|
||||
} else {
|
||||
this._win.removeAllListeners('swipe');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private registerSwipeListener() {
|
||||
this._win.on('swipe', (event: Electron.Event, cmd: string) => {
|
||||
if (!this.isReady) {
|
||||
return; // window must be ready
|
||||
}
|
||||
|
||||
if (cmd === 'left') {
|
||||
this.send('vscode:runAction', { id: 'workbench.action.openPreviousRecentlyUsedEditor', from: 'mouse' } as IRunActionInWindowRequest);
|
||||
} else if (cmd === 'right') {
|
||||
this.send('vscode:runAction', { id: 'workbench.action.openNextRecentlyUsedEditor', from: 'mouse' } as IRunActionInWindowRequest);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
addTabbedWindow(window: ICodeWindow): void {
|
||||
|
||||
Reference in New Issue
Block a user