@@ -38,6 +38,7 @@ export interface IDialogOptions {
3838 readonly buttonDetails ?: string [ ] ;
3939 readonly disableCloseAction ?: boolean ;
4040 readonly disableDefaultAction ?: boolean ;
41+ readonly buttonStyles : IButtonStyles ;
4142}
4243
4344export interface IDialogResult {
@@ -46,7 +47,7 @@ export interface IDialogResult {
4647 readonly values ?: string [ ] ;
4748}
4849
49- export interface IDialogStyles extends IButtonStyles , ICheckboxStyles {
50+ export interface IDialogStyles extends ICheckboxStyles {
5051 readonly dialogForeground ?: Color ;
5152 readonly dialogBackground ?: Color ;
5253 readonly dialogShadow ?: Color ;
@@ -81,8 +82,9 @@ export class Dialog extends Disposable {
8182 private focusToReturn : HTMLElement | undefined ;
8283 private readonly inputs : InputBox [ ] ;
8384 private readonly buttons : string [ ] ;
85+ private readonly buttonStyles : IButtonStyles ;
8486
85- constructor ( private container : HTMLElement , private message : string , buttons : string [ ] | undefined , private options : IDialogOptions ) {
87+ constructor ( private container : HTMLElement , private message : string , buttons : string [ ] | undefined , private readonly options : IDialogOptions ) {
8688 super ( ) ;
8789
8890 this . modalElement = this . container . appendChild ( $ ( `.monaco-dialog-modal-block.dimmed` ) ) ;
@@ -92,6 +94,8 @@ export class Dialog extends Disposable {
9294 this . element . tabIndex = - 1 ;
9395 hide ( this . element ) ;
9496
97+ this . buttonStyles = options . buttonStyles ;
98+
9599 if ( Array . isArray ( buttons ) && buttons . length > 0 ) {
96100 this . buttons = buttons ;
97101 } else if ( ! this . options . disableDefaultAction ) {
@@ -202,7 +206,7 @@ export class Dialog extends Disposable {
202206 // Handle button clicks
203207 buttonMap . forEach ( ( entry , index ) => {
204208 const primary = buttonMap [ index ] . index === 0 ;
205- const button = this . options . buttonDetails ? this . _register ( buttonBar . addButtonWithDescription ( { title : true , secondary : ! primary } ) ) : this . _register ( buttonBar . addButton ( { title : true , secondary : ! primary } ) ) ;
209+ const button = this . options . buttonDetails ? this . _register ( buttonBar . addButtonWithDescription ( { title : true , secondary : ! primary , ... this . buttonStyles } ) ) : this . _register ( buttonBar . addButton ( { title : true , secondary : ! primary , ... this . buttonStyles } ) ) ;
206210 button . label = mnemonicButtonLabel ( buttonMap [ index ] . label , true ) ;
207211 if ( button instanceof ButtonWithDescription ) {
208212 button . description = this . options . buttonDetails ! [ buttonMap [ index ] . index ] ;
0 commit comments