Fix BDC table icons (#13539)

This commit is contained in:
Charles Gagnon
2020-11-24 15:36:22 -08:00
committed by GitHub
parent b03a914934
commit a0d89449cc
2 changed files with 8 additions and 6 deletions

View File

@@ -369,18 +369,16 @@ export class BdcDashboardOverviewPage extends BdcDashboardPage {
});
endpoints.unshift(...sqlServerMasterEndpoints);
this.endpointsTable.data = endpoints.map(e => {
this.endpointsTable.dataValues = endpoints.map(e => {
const copyValueCell = this.modelView.modelBuilder.button().withProperties<azdata.ButtonProperties>({ title: loc.copy }).component();
copyValueCell.iconPath = IconPathHelper.copy;
copyValueCell.onDidClick(() => {
vscode.env.clipboard.writeText(e.endpoint);
vscode.window.showInformationMessage(loc.copiedEndpoint(getEndpointDisplayText(e.name, e.description)));
});
copyValueCell.iconHeight = '14px';
copyValueCell.iconWidth = '14px';
return [getEndpointDisplayText(e.name, e.description),
createEndpointComponent(this.modelView.modelBuilder, e, this.model, hyperlinkedEndpoints.some(he => he === e.name)),
copyValueCell];
return [{ value: getEndpointDisplayText(e.name, e.description) },
{ value: createEndpointComponent(this.modelView.modelBuilder, e, this.model, hyperlinkedEndpoints.some(he => he === e.name)) },
{ value: copyValueCell }];
});
this.endpointsDisplayContainer.removeItem(this.endpointsLoadingComponent);

View File

@@ -157,6 +157,10 @@ export default class ButtonComponent extends ComponentWithIconBase<azdata.Button
if (this.iconPath) {
this._button.element.style.backgroundSize = `${this.getIconWidth()} ${this.getIconHeight()}`;
this._button.element.style.paddingLeft = this.getIconWidth();
// If we have an icon but no specified height then default to the height of the icon so we're sure it fits
if (this.height === undefined) {
this._button.setHeight(convertSize(this.getIconHeight().toString()));
}
}
}