Skip to content

Commit

Permalink
quick pick - hide input in more cases of quick nav (#147493)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Apr 15, 2022
1 parent 4f03e1b commit 2e10985
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/vs/base/parts/quickinput/browser/quickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,7 @@ export class QuickInputController extends Disposable {
input.matchOnLabel = (options.matchOnLabel === undefined) || options.matchOnLabel; // default to true
input.autoFocusOnList = (options.autoFocusOnList === undefined) || options.autoFocusOnList; // default to true
input.quickNavigate = options.quickNavigate;
input.hideInput = !!options.hideInput;
input.contextKey = options.contextKey;
input.busy = true;
Promise.all([picks, options.activeItem])
Expand Down
7 changes: 7 additions & 0 deletions src/vs/base/parts/quickinput/common/quickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ export interface IPickOptions<T extends IQuickPickItem> {
*/
quickNavigate?: IQuickNavigateConfiguration;

/**
* Hides the input box from the picker UI. This is typically used
* in combination with quick-navigation where no search UI should
* be presented.
*/
hideInput?: boolean;

/**
* a context key to set when this picker is active
*/
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/browser/actions/windowActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ abstract class BaseOpenRecentAction extends Action2 {
matchOnDescription: true,
onKeyMods: mods => keyMods = mods,
quickNavigate: this.isQuickNavigate() ? { keybindings: keybindingService.lookupKeybindings(this.desc.id) } : undefined,
hideInput: this.isQuickNavigate(),
onDidTriggerItemButton: async context => {

// Remove
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/electron-sandbox/actions/windowActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ abstract class BaseSwitchWindow extends Action2 {
activeItem: picks[autoFocusIndex],
placeHolder,
quickNavigate: this.isQuickNavigate() ? { keybindings: keybindingService.lookupKeybindings(this.desc.id) } : undefined,
hideInput: this.isQuickNavigate(),
onDidTriggerItemButton: async context => {
await nativeHostService.closeWindowById(context.item.payload);
context.removeItem();
Expand Down

0 comments on commit 2e10985

Please sign in to comment.