mirror of
https://github.com/Microsoft/vscode
synced 2024-10-05 19:02:54 +00:00
fix primary and secondary buttons order (#214603)
This commit is contained in:
parent
bab3a9fdcb
commit
d08886ba68
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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], []],
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue