提交 d5ef5acd 编写于 作者: B Benjamin Pasero

fix #43229

上级 11bd2bfa
......@@ -364,8 +364,14 @@ const DefaultMultipleSelectionContoller = {
};
const DefaultOpenController = {
shouldOpen: (event: UIEvent) => true
};
shouldOpen: (event: UIEvent) => {
if (event instanceof MouseEvent) {
return event.button === 0 /* left mouse button */ || event.button === 1 /* middle mouse button */;
}
return true;
}
} as IOpenController;
class MouseController<T> implements IDisposable {
......
......@@ -125,15 +125,18 @@ class MultipleSelectionController<T> implements IMultipleSelectionController<T>
}
}
class OpenController implements IOpenController {
class WorkbenchOpenController implements IOpenController {
constructor(private configurationService: IConfigurationService) { }
shouldOpen(event: UIEvent): boolean {
if (event instanceof MouseEvent) {
const isDoubleClick = event.detail === 2;
if (!useSingleClickToOpen(this.configurationService) && !isDoubleClick) {
return false;
}
return useSingleClickToOpen(this.configurationService) || isDoubleClick;
return event.button === 0 /* left mouse button */ || event.button === 1 /* middle mouse button */;
}
return true;
......@@ -145,7 +148,7 @@ function handleListControllers<T>(options: IListOptions<T>, configurationService
options.multipleSelectionController = new MultipleSelectionController(configurationService);
}
options.openController = new OpenController(configurationService);
options.openController = new WorkbenchOpenController(configurationService);
return options;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册