mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add width and height properties to checkbox component (#7482)
This commit is contained in:
@@ -100,6 +100,14 @@ export class Checkbox extends Widget {
|
|||||||
this.enabled = true;
|
this.enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setHeight(value: string) {
|
||||||
|
this._el.style.height = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public setWidth(value: string) {
|
||||||
|
this._el.style.width = value;
|
||||||
|
}
|
||||||
|
|
||||||
public style(styles: ICheckboxStyles): void {
|
public style(styles: ICheckboxStyles): void {
|
||||||
this.disabledCheckboxForeground = styles.disabledCheckboxForeground;
|
this.disabledCheckboxForeground = styles.disabledCheckboxForeground;
|
||||||
this.updateStyle();
|
this.updateStyle();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/work
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'modelview-checkbox',
|
selector: 'modelview-checkbox',
|
||||||
template: `
|
template: `
|
||||||
<div #input [style.width]="getWidth()"></div>
|
<div #input [style.width]="getWidth()" [style.height]="getHeight()"></div>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export default class CheckBoxComponent extends ComponentBase implements IComponent, OnDestroy, AfterViewInit {
|
export default class CheckBoxComponent extends ComponentBase implements IComponent, OnDestroy, AfterViewInit {
|
||||||
@@ -82,6 +82,12 @@ export default class CheckBoxComponent extends ComponentBase implements ICompone
|
|||||||
} else {
|
} else {
|
||||||
this._input.disable();
|
this._input.disable();
|
||||||
}
|
}
|
||||||
|
if (this.width) {
|
||||||
|
this._input.setWidth(this.convertSize(this.width));
|
||||||
|
}
|
||||||
|
if (this.height) {
|
||||||
|
this._input.setHeight(this.convertSize(this.height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSS-bound properties
|
// CSS-bound properties
|
||||||
|
|||||||
Reference in New Issue
Block a user