fix primary and secondary buttons order (#214603)

This commit is contained in:
Sandeep Somavarapu 2024-06-07 16:11:24 +02:00 committed by GitHub
parent bab3a9fdcb
commit d08886ba68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 18 deletions

View file

@ -731,6 +731,23 @@ class ProfileWidget extends Disposable {
if (primaryTitleButtons?.length || secondatyTitleButtons?.length) {
this.buttonContainer.classList.remove('hide');
if (secondatyTitleButtons?.length) {
for (const action of secondatyTitleButtons) {
const button = disposables.add(new Button(this.buttonContainer, {
...defaultButtonStyles,
secondary: true
}));
button.label = action.label;
button.enabled = action.enabled;
disposables.add(button.onDidClick(() => this.editorProgressService.showWhile(action.run())));
disposables.add(action.onDidChange((e) => {
if (!isUndefined(e.enabled)) {
button.enabled = action.enabled;
}
}));
}
}
if (primaryTitleButtons?.length) {
for (const action of primaryTitleButtons) {
const button = disposables.add(new Button(this.buttonContainer, {
@ -753,23 +770,6 @@ class ProfileWidget extends Disposable {
}
}
if (secondatyTitleButtons?.length) {
for (const action of secondatyTitleButtons) {
const button = disposables.add(new Button(this.buttonContainer, {
...defaultButtonStyles,
secondary: true
}));
button.label = action.label;
button.enabled = action.enabled;
disposables.add(button.onDidClick(() => this.editorProgressService.showWhile(action.run())));
disposables.add(action.onDidChange((e) => {
if (!isUndefined(e.enabled)) {
button.enabled = action.enabled;
}
}));
}
}
} else {
this.buttonContainer.classList.add('hide');
}

View file

@ -825,7 +825,7 @@ export class UserDataProfilesEditorModel extends EditorModel {
this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement,
copyFrom ? '' : localize('untitled', "Untitled"),
copyFrom,
[[createAction], [previewProfileAction, cancelAction]],
[[createAction], [cancelAction, previewProfileAction]],
[[], []],
[[cancelAction], []],
));