@@ -33,6 +33,8 @@ import { IConfigurationService } from '../../configuration/common/configuration.
33
33
import { Platform , platform } from '../../../base/common/platform.js' ;
34
34
import { getWindowControlsStyle , WindowControlsStyle } from '../../window/common/window.js' ;
35
35
import { getZoomFactor } from '../../../base/browser/browser.js' ;
36
+ import { Checkbox } from '../../../base/browser/ui/toggle/toggle.js' ;
37
+ import { defaultCheckboxStyles } from '../../theme/browser/defaultStyles.js' ;
36
38
37
39
const $ = dom . $ ;
38
40
@@ -120,7 +122,7 @@ export class QuickInputController extends Disposable {
120
122
}
121
123
}
122
124
123
- private getUI ( showInActiveContainer ?: boolean ) {
125
+ private getUI ( showInActiveContainer ?: boolean ) : QuickInputUI {
124
126
if ( this . ui ) {
125
127
// In order to support aux windows, re-parent the controller
126
128
// if the original event is from a different document
@@ -152,14 +154,13 @@ export class QuickInputController extends Disposable {
152
154
153
155
const headerContainer = dom . append ( container , $ ( '.quick-input-header' ) ) ;
154
156
155
- const checkAll = < HTMLInputElement > dom . append ( headerContainer , $ ( 'input.quick-input-check-all' ) ) ;
156
- checkAll . type = 'checkbox' ;
157
- checkAll . setAttribute ( 'aria-label' , localize ( 'quickInput.checkAll' , "Toggle all checkboxes" ) ) ;
158
- this . _register ( dom . addStandardDisposableListener ( checkAll , dom . EventType . CHANGE , e => {
157
+ const checkAll = this . _register ( new Checkbox ( localize ( 'quickInput.checkAll' , "Toggle all checkboxes" ) , false , { ...defaultCheckboxStyles , size : 15 } ) ) ;
158
+ dom . append ( headerContainer , checkAll . domNode ) ;
159
+ this . _register ( checkAll . onChange ( ( ) => {
159
160
const checked = checkAll . checked ;
160
161
list . setAllVisibleChecked ( checked ) ;
161
162
} ) ) ;
162
- this . _register ( dom . addDisposableListener ( checkAll , dom . EventType . CLICK , e => {
163
+ this . _register ( dom . addDisposableListener ( checkAll . domNode , dom . EventType . CLICK , e => {
163
164
if ( e . x || e . y ) { // Avoid 'click' triggered by 'space'...
164
165
inputBox . setFocus ( ) ;
165
166
}
@@ -688,7 +689,7 @@ export class QuickInputController extends Disposable {
688
689
ui . title . style . display = visibilities . title ? '' : 'none' ;
689
690
ui . description1 . style . display = visibilities . description && ( visibilities . inputBox || visibilities . checkAll ) ? '' : 'none' ;
690
691
ui . description2 . style . display = visibilities . description && ! ( visibilities . inputBox || visibilities . checkAll ) ? '' : 'none' ;
691
- ui . checkAll . style . display = visibilities . checkAll ? '' : 'none' ;
692
+ ui . checkAll . domNode . style . display = visibilities . checkAll ? '' : 'none' ;
692
693
ui . inputContainer . style . display = visibilities . inputBox ? '' : 'none' ;
693
694
ui . filterContainer . style . display = visibilities . inputBox ? '' : 'none' ;
694
695
ui . visibleCountContainer . style . display = visibilities . visibleCount ? '' : 'none' ;
@@ -706,16 +707,21 @@ export class QuickInputController extends Disposable {
706
707
private setEnabled ( enabled : boolean ) {
707
708
if ( enabled !== this . enabled ) {
708
709
this . enabled = enabled ;
709
- for ( const item of this . getUI ( ) . leftActionBar . viewItems ) {
710
+ const ui = this . getUI ( ) ;
711
+ for ( const item of ui . leftActionBar . viewItems ) {
710
712
( item as ActionViewItem ) . action . enabled = enabled ;
711
713
}
712
- for ( const item of this . getUI ( ) . rightActionBar . viewItems ) {
714
+ for ( const item of ui . rightActionBar . viewItems ) {
713
715
( item as ActionViewItem ) . action . enabled = enabled ;
714
716
}
715
- this . getUI ( ) . checkAll . disabled = ! enabled ;
716
- this . getUI ( ) . inputBox . enabled = enabled ;
717
- this . getUI ( ) . ok . enabled = enabled ;
718
- this . getUI ( ) . list . enabled = enabled ;
717
+ if ( enabled ) {
718
+ ui . checkAll . enable ( ) ;
719
+ } else {
720
+ ui . checkAll . disable ( ) ;
721
+ }
722
+ ui . inputBox . enabled = enabled ;
723
+ ui . ok . enabled = enabled ;
724
+ ui . list . enabled = enabled ;
719
725
}
720
726
}
721
727
0 commit comments