diff --git a/src/sql/platform/theme/common/styler.ts b/src/sql/platform/theme/common/styler.ts index 39c823701a..97f9ecf911 100644 --- a/src/sql/platform/theme/common/styler.ts +++ b/src/sql/platform/theme/common/styler.ts @@ -283,12 +283,14 @@ export function attachEditableDropdownStyler(widget: IThemable, themeService: IT }, widget); } -export function attachButtonStyler(widget: IThemable, themeService: IThemeService, style?: { +type ButtonStyle = { buttonForeground?: cr.ColorIdentifier, buttonBackground?: cr.ColorIdentifier, buttonHoverBackground?: cr.ColorIdentifier, buttonFocusOutline?: cr.ColorIdentifier -}): IDisposable { +}; + +export function attachButtonStyler(widget: IThemable, themeService: IThemeService, style?: ButtonStyle): IDisposable { return attachStyler(themeService, { buttonForeground: (style && style.buttonForeground) || cr.buttonForeground, buttonBackground: (style && style.buttonBackground) || cr.buttonBackground, diff --git a/src/sql/workbench/browser/modelComponents/button.component.ts b/src/sql/workbench/browser/modelComponents/button.component.ts index 0f9b135cb1..e65f7a6b04 100644 --- a/src/sql/workbench/browser/modelComponents/button.component.ts +++ b/src/sql/workbench/browser/modelComponents/button.component.ts @@ -23,6 +23,7 @@ import { IComponentDescriptor, IComponent, IModelStore, ComponentEventType } fro import { convertSize } from 'sql/base/browser/dom'; import { createIconCssClass } from 'sql/workbench/browser/modelComponents/iconUtils'; import { ILogService } from 'vs/platform/log/common/log'; +import { IDisposable } from 'vs/base/common/lifecycle'; @Component({ selector: 'modelview-button', @@ -40,13 +41,13 @@ import { ILogService } from 'vs/platform/log/common/log'; ` }) - export default class ButtonComponent extends ComponentWithIconBase implements IComponent, OnDestroy { @Input() descriptor: IComponentDescriptor; @Input() modelStore: IModelStore; private _button: Button | InfoButton; public fileType: string = '.sql'; private _currentButtonType?: azdata.ButtonType = undefined; + private _buttonStyler: IDisposable | undefined = undefined; @ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef; @ViewChild('fileInput', { read: ElementRef }) private _fileInputContainer: ElementRef; @@ -89,9 +90,7 @@ export default class ButtonComponent extends ComponentWithIconBase { if (this._fileInputContainer) { const self = this; @@ -119,6 +118,7 @@ export default class ButtonComponent extends ComponentWithIconBase