mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-19 22:42:35 +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 {
|
||||
|
||||
@@ -185,7 +185,6 @@ const configurationValueWhitelist = [
|
||||
'workbench.editor.enablePreviewFromQuickOpen',
|
||||
'workbench.editor.showTabs',
|
||||
'workbench.editor.highlightModifiedTabs',
|
||||
'workbench.editor.swipeToNavigate',
|
||||
'workbench.sideBar.location',
|
||||
'workbench.startupEditor',
|
||||
'workbench.statusBar.visible',
|
||||
|
||||
@@ -107,12 +107,6 @@ import { isMacintosh, isWindows, isLinux, isWeb } from 'vs/base/common/platform'
|
||||
'description': nls.localize('revealIfOpen', "Controls whether an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, e.g. when forcing an editor to open in a specific group or to the side of the currently active group."),
|
||||
'default': false
|
||||
},
|
||||
'workbench.editor.swipeToNavigate': {
|
||||
'type': 'boolean',
|
||||
'description': nls.localize('swipeToNavigate', "Navigate between open files using three-finger swipe horizontally."),
|
||||
'default': false,
|
||||
'included': isMacintosh && !isWeb
|
||||
},
|
||||
'workbench.editor.mouseBackForwardToNavigate': {
|
||||
'type': 'boolean',
|
||||
'description': nls.localize('mouseBackForwardToNavigate', "Navigate between open files using mouse buttons four and five if provided."),
|
||||
|
||||
@@ -986,7 +986,6 @@ interface IEditorPartConfiguration {
|
||||
openSideBySideDirection?: 'right' | 'down';
|
||||
closeEmptyGroups?: boolean;
|
||||
revealIfOpen?: boolean;
|
||||
swipeToNavigate?: boolean;
|
||||
mouseBackForwardToNavigate?: boolean;
|
||||
labelFormat?: 'default' | 'short' | 'medium' | 'long';
|
||||
restoreViewState?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user