diff --git a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.component.ts b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.component.ts
index c4b4df0fa0..df6b13f920 100644
--- a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.component.ts
+++ b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.component.ts
@@ -5,7 +5,7 @@
import 'vs/css!./dashboardHomeContainer';
-import { Component, forwardRef, Input, ChangeDetectorRef, Inject, ViewChild, ContentChild } from '@angular/core';
+import { Component, forwardRef, Input, ChangeDetectorRef, Inject, ViewChild, ContentChild, ElementRef } from '@angular/core';
import { DashboardWidgetContainer } from 'sql/workbench/contrib/dashboard/browser/containers/dashboardWidgetContainer.component';
import { WidgetConfig } from 'sql/workbench/contrib/dashboard/browser/core/dashboardWidget';
@@ -18,6 +18,10 @@ import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
+import { DASHBOARD_BORDER } from 'vs/workbench/common/theme';
+import { IColorTheme } from 'vs/platform/theme/common/themeService';
+import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
+import { contrastBorder } from 'vs/platform/theme/common/colorRegistry';
@Component({
selector: 'dashboard-home-container',
@@ -25,9 +29,11 @@ import { ScrollbarVisibility } from 'vs/base/common/scrollable';
template: `
@@ -37,25 +43,36 @@ import { ScrollbarVisibility } from 'vs/base/common/scrollable';
export class DashboardHomeContainer extends DashboardWidgetContainer {
@Input() private properties: WidgetConfig;
@ViewChild('propertiesClass') private _propertiesClass: DashboardWidgetWrapper;
+ @ViewChild('propertiesContainer') private _propertiesContainer: ElementRef;
@ContentChild(ScrollableDirective) private _scrollable: ScrollableDirective;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) _cd: ChangeDetectorRef,
@Inject(forwardRef(() => CommonServiceInterface)) protected dashboardService: DashboardServiceInterface,
@Inject(IConfigurationService) private _configurationService: IConfigurationService,
- @Inject(IAngularEventingService) private angularEventingService: IAngularEventingService
+ @Inject(IAngularEventingService) private angularEventingService: IAngularEventingService,
+ @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService
) {
super(_cd);
}
ngAfterContentInit() {
+ this.updateTheme(this.themeService.getColorTheme());
+ this._register(this.themeService.onDidColorThemeChange((event: IColorTheme) => {
+ this.updateTheme(event);
+ }));
+
const collapsedVal = this.dashboardService.getSettings
(`${this.properties.context}.properties`);
if (collapsedVal === 'collapsed') {
this._propertiesClass.collapsed = true;
+ this._propertiesClass.showTitle = true;
+ } else {
+ this._propertiesClass.showTitle = false;
}
this._register(this.angularEventingService.onAngularEvent(this.dashboardService.getUnderlyingUri())(event => {
if (event.event === AngularEventType.COLLAPSE_WIDGET && this._propertiesClass && event.payload === this._propertiesClass.guid) {
this._propertiesClass.collapsed = !this._propertiesClass.collapsed;
+ this._propertiesClass.showTitle = !this._propertiesClass.showTitle;
this._cd.detectChanges();
this._configurationService.updateValue(`dashboard.${this.properties.context}.properties`,
this._propertiesClass.collapsed ? 'collapsed' : true, ConfigurationTarget.USER);
@@ -70,6 +87,15 @@ export class DashboardHomeContainer extends DashboardWidgetContainer {
}
}
+ private updateTheme(theme: IColorTheme): void {
+ const border = theme.getColor(DASHBOARD_BORDER);
+ if (theme.getColor(contrastBorder)) {
+ this._propertiesContainer.nativeElement.style.borderBottom = 'none';
+ } else {
+ this._propertiesContainer.nativeElement.style.borderBottom = '1px solid ' + border.toString();
+ }
+ }
+
public refresh(): void {
super.refresh();
this._propertiesClass.refresh();
diff --git a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.css b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.css
index e134cbd8f1..8e03b2c3ff 100644
--- a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.css
+++ b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.css
@@ -8,3 +8,10 @@ dashboard-home-tab {
width: 100%;
display: block;
}
+
+dashboard-home-container .properties {
+ padding-left: 10px;
+ padding-right: 10px;
+ display: block;
+ flex: 0;
+}
diff --git a/src/sql/workbench/contrib/dashboard/browser/contents/dashboardWidgetWrapper.component.html b/src/sql/workbench/contrib/dashboard/browser/contents/dashboardWidgetWrapper.component.html
index c553144ea4..a4d2d92878 100644
--- a/src/sql/workbench/contrib/dashboard/browser/contents/dashboardWidgetWrapper.component.html
+++ b/src/sql/workbench/contrib/dashboard/browser/contents/dashboardWidgetWrapper.component.html
@@ -4,18 +4,18 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-->
-