@@ -15,7 +15,6 @@ import { IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/lis
15
15
import { IListOptions , IListStyles , List } from 'vs/base/browser/ui/list/listWidget' ;
16
16
import { IProgressBarStyles , ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar' ;
17
17
import { IToggleStyles , Toggle } from 'vs/base/browser/ui/toggle/toggle' ;
18
- import { Action } from 'vs/base/common/actions' ;
19
18
import { equals } from 'vs/base/common/arrays' ;
20
19
import { TimeoutTimer } from 'vs/base/common/async' ;
21
20
import { Codicon } from 'vs/base/common/codicons' ;
@@ -30,7 +29,7 @@ import { localize } from 'vs/nls';
30
29
import { IInputBox , IKeyMods , IQuickInput , IQuickInputButton , IQuickInputHideEvent , IQuickInputToggle , IQuickNavigateConfiguration , IQuickPick , IQuickPickDidAcceptEvent , IQuickPickItem , IQuickPickItemButtonEvent , IQuickPickSeparator , IQuickPickSeparatorButtonEvent , IQuickPickWillAcceptEvent , IQuickWidget , ItemActivation , NO_KEY_MODS , QuickInputHideReason } from 'vs/platform/quickinput/common/quickInput' ;
31
30
import { QuickInputBox } from './quickInputBox' ;
32
31
import { QuickInputList , QuickInputListFocus } from './quickInputList' ;
33
- import { getIconClass , renderQuickInputDescription } from './quickInputUtils' ;
32
+ import { quickInputButtonToAction , renderQuickInputDescription } from './quickInputUtils' ;
34
33
35
34
export interface IQuickInputOptions {
36
35
idPrefix : string ;
@@ -388,23 +387,23 @@ class QuickInput extends Disposable implements IQuickInput {
388
387
if ( this . buttonsUpdated ) {
389
388
this . buttonsUpdated = false ;
390
389
this . ui . leftActionBar . clear ( ) ;
391
- const leftButtons = this . buttons . filter ( button => button === backButton ) ;
392
- this . ui . leftActionBar . push ( leftButtons . map ( ( button , index ) => {
393
- const action = new Action ( `id- ${ index } ` , '' , button . iconClass || getIconClass ( button . iconPath ) , true , async ( ) => {
394
- this . onDidTriggerButtonEmitter . fire ( button ) ;
395
- } ) ;
396
- action . tooltip = button . tooltip || '' ;
397
- return action ;
398
- } ) , { icon : true , label : false } ) ;
390
+ const leftButtons = this . buttons
391
+ . filter ( button => button === backButton )
392
+ . map ( ( button , index ) => quickInputButtonToAction (
393
+ button ,
394
+ `id- ${ index } ` ,
395
+ async ( ) => this . onDidTriggerButtonEmitter . fire ( button )
396
+ ) ) ;
397
+ this . ui . leftActionBar . push ( leftButtons , { icon : true , label : false } ) ;
399
398
this . ui . rightActionBar . clear ( ) ;
400
- const rightButtons = this . buttons . filter ( button => button !== backButton ) ;
401
- this . ui . rightActionBar . push ( rightButtons . map ( ( button , index ) => {
402
- const action = new Action ( `id- ${ index } ` , '' , button . iconClass || getIconClass ( button . iconPath ) , true , async ( ) => {
403
- this . onDidTriggerButtonEmitter . fire ( button ) ;
404
- } ) ;
405
- action . tooltip = button . tooltip || '' ;
406
- return action ;
407
- } ) , { icon : true , label : false } ) ;
399
+ const rightButtons = this . buttons
400
+ . filter ( button => button !== backButton )
401
+ . map ( ( button , index ) => quickInputButtonToAction (
402
+ button ,
403
+ `id- ${ index } ` ,
404
+ async ( ) => this . onDidTriggerButtonEmitter . fire ( button )
405
+ ) ) ;
406
+ this . ui . rightActionBar . push ( rightButtons , { icon : true , label : false } ) ;
408
407
}
409
408
if ( this . togglesUpdated ) {
410
409
this . togglesUpdated = false ;
0 commit comments