mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-07 17:23:56 -05:00
Merge from vscode merge-base (#22780)
* Revert "Revert "Merge from vscode merge-base (#22769)" (#22779)"
This reverts commit 47a1745180.
* Fix notebook download task
* Remove done call from extensions-ci
This commit is contained in:
@@ -98,6 +98,7 @@ export class Toggle extends Widget {
|
||||
readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;
|
||||
|
||||
private readonly _opts: IToggleOpts;
|
||||
private _icon: CSSIcon | undefined;
|
||||
readonly domNode: HTMLElement;
|
||||
|
||||
private _checked: boolean;
|
||||
@@ -110,7 +111,8 @@ export class Toggle extends Widget {
|
||||
|
||||
const classes = ['monaco-custom-toggle'];
|
||||
if (this._opts.icon) {
|
||||
classes.push(...CSSIcon.asClassNameArray(this._opts.icon));
|
||||
this._icon = this._opts.icon;
|
||||
classes.push(...CSSIcon.asClassNameArray(this._icon));
|
||||
}
|
||||
if (this._opts.actionClassName) {
|
||||
classes.push(...this._opts.actionClassName.split(' '));
|
||||
@@ -146,6 +148,7 @@ export class Toggle extends Widget {
|
||||
this.checked = !this._checked;
|
||||
this._onChange.fire(true);
|
||||
keyboardEvent.preventDefault();
|
||||
keyboardEvent.stopPropagation();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -174,6 +177,16 @@ export class Toggle extends Widget {
|
||||
this.applyStyles();
|
||||
}
|
||||
|
||||
setIcon(icon: CSSIcon | undefined): void {
|
||||
if (this._icon) {
|
||||
this.domNode.classList.remove(...CSSIcon.asClassNameArray(this._icon));
|
||||
}
|
||||
this._icon = icon;
|
||||
if (this._icon) {
|
||||
this.domNode.classList.add(...CSSIcon.asClassNameArray(this._icon));
|
||||
}
|
||||
}
|
||||
|
||||
width(): number {
|
||||
return 2 /*margin left*/ + 2 /*border*/ + 2 /*padding*/ + 16 /* icon width */;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user