mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
Automatically focus the execute button in the DacFx wizard summary screens (#6984)
* Focus piping for extension buttons * Focus the done button when entering the summary page for DacFx wizard * Adding internal value resets for extension-side button model. * Correcting remark string
This commit is contained in:
@@ -207,6 +207,7 @@ class ButtonImpl implements azdata.window.Button {
|
||||
private _label: string;
|
||||
private _enabled: boolean;
|
||||
private _hidden: boolean;
|
||||
private _focused: boolean;
|
||||
|
||||
private _onClick = new Emitter<void>();
|
||||
public onClick = this._onClick.event;
|
||||
@@ -243,6 +244,23 @@ class ButtonImpl implements azdata.window.Button {
|
||||
this._extHostModelViewDialog.updateButton(this);
|
||||
}
|
||||
|
||||
public get focused(): boolean {
|
||||
return this._focused;
|
||||
}
|
||||
|
||||
/**
|
||||
* Focuses the button when set to "true", then the internal value is immediately reset to 'undefined'.
|
||||
*
|
||||
* @remarks
|
||||
* Because communication between ADS and extensions is unidirectional, a focus change by the user is not
|
||||
* communicated to the extension. The internal value is reset to avoid inconsistent models of where focus is.
|
||||
*/
|
||||
public set focused(focused: boolean) {
|
||||
this._focused = focused;
|
||||
this._extHostModelViewDialog.updateButton(this);
|
||||
this._focused = undefined;
|
||||
}
|
||||
|
||||
public getOnClickCallback(): () => void {
|
||||
return () => this._onClick.fire();
|
||||
}
|
||||
@@ -568,7 +586,8 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
|
||||
this._proxy.$setButtonDetails(handle, {
|
||||
label: button.label,
|
||||
enabled: button.enabled,
|
||||
hidden: button.hidden
|
||||
hidden: button.hidden,
|
||||
focused: button.focused
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -251,6 +251,7 @@ export interface IModelViewButtonDetails {
|
||||
label: string;
|
||||
enabled: boolean;
|
||||
hidden: boolean;
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export interface IModelViewWizardPageDetails {
|
||||
|
||||
Reference in New Issue
Block a user