mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add tab coloring by server group (#383)
This commit is contained in:
@@ -87,6 +87,8 @@ export interface IEditorGroupsControl {
|
||||
|
||||
getRatio(): number[];
|
||||
|
||||
// {{SQL CARBON EDIT}} -- Allow editor titles to be refreshed to support tab coloring
|
||||
refreshTitles(): void;
|
||||
|
||||
dispose(): void;
|
||||
}
|
||||
@@ -2126,6 +2128,14 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
}
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}} -- Allow editor titles to be refreshed to support tab coloring
|
||||
public refreshTitles(): void {
|
||||
POSITIONS.forEach(position => {
|
||||
let titleControl = this.getTitleAreaControl(position);
|
||||
titleControl.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
super.dispose();
|
||||
|
||||
|
||||
@@ -1359,6 +1359,11 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
return sizes;
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}} -- Allow editor titles to be refreshed to support tab coloring
|
||||
public refreshEditorTitles(): void {
|
||||
this.editorGroupsControl.refreshTitles();
|
||||
}
|
||||
|
||||
public shutdown(): void {
|
||||
|
||||
// Persist UI State
|
||||
|
||||
@@ -39,12 +39,15 @@ import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
import { extractResources } from 'vs/base/browser/dnd';
|
||||
import { getOrSet } from 'vs/base/common/map';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService';
|
||||
import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_INACTIVE_FOREGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_ACTIVE_BORDER } from 'vs/workbench/common/theme';
|
||||
import { activeContrastBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
|
||||
// {{SQL CARBON EDIT}} -- Display the editor's tab color
|
||||
import { Color } from 'vs/base/common/color';
|
||||
|
||||
interface IEditorInputLabel {
|
||||
name: string;
|
||||
description?: string;
|
||||
@@ -330,6 +333,20 @@ export class TabsTitleControl extends TitleControl {
|
||||
} else {
|
||||
DOM.removeClass(tabContainer, 'dirty');
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}} -- Display the editor's tab color
|
||||
let sqlEditor = editor as any;
|
||||
if (sqlEditor.tabColor && this.themeService.getTheme().type !== HIGH_CONTRAST) {
|
||||
tabContainer.style.borderTopColor = sqlEditor.tabColor;
|
||||
tabContainer.style.borderTopWidth = isTabActive ? '2px' : '1px';
|
||||
let backgroundColor = Color.Format.CSS.parseHex(sqlEditor.tabColor);
|
||||
if (backgroundColor) {
|
||||
tabContainer.style.backgroundColor = backgroundColor.transparent(isTabActive ? 0.3 : 0.2).toString();
|
||||
}
|
||||
} else {
|
||||
tabContainer.style.borderTopColor = '';
|
||||
tabContainer.style.borderTopWidth = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user