@@ -25,7 +25,7 @@ import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElemen
2525import { ScrollbarVisibility } from 'vs/base/common/scrollable' ;
2626import { getOrSet } from 'vs/base/common/map' ;
2727import { IThemeService , registerThemingParticipant , ITheme , ICssStyleCollector } from 'vs/platform/theme/common/themeService' ;
28- 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 , TAB_HOVER_BACKGROUND , TAB_HOVER_BORDER , TAB_UNFOCUSED_HOVER_BACKGROUND , TAB_UNFOCUSED_HOVER_BORDER , EDITOR_GROUP_HEADER_TABS_BACKGROUND , WORKBENCH_BACKGROUND , TAB_ACTIVE_BORDER_TOP , TAB_UNFOCUSED_ACTIVE_BORDER_TOP , TAB_ACTIVE_MODIFIED_BORDER , TAB_INACTIVE_MODIFIED_BORDER , TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER , TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER } from 'vs/workbench/common/theme' ;
28+ 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_BACKGROUND , TAB_UNFOCUSED_ACTIVE_BORDER , TAB_ACTIVE_BORDER , TAB_HOVER_BACKGROUND , TAB_HOVER_BORDER , TAB_UNFOCUSED_HOVER_BACKGROUND , TAB_UNFOCUSED_HOVER_BORDER , EDITOR_GROUP_HEADER_TABS_BACKGROUND , WORKBENCH_BACKGROUND , TAB_ACTIVE_BORDER_TOP , TAB_UNFOCUSED_ACTIVE_BORDER_TOP , TAB_ACTIVE_MODIFIED_BORDER , TAB_INACTIVE_MODIFIED_BORDER , TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER , TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER } from 'vs/workbench/common/theme' ;
2929import { activeContrastBorder , contrastBorder , editorBackground , breadcrumbsBackground } from 'vs/platform/theme/common/colorRegistry' ;
3030import { ResourcesDropHandler , fillResourceDataTransfers , DraggedEditorIdentifier , DraggedEditorGroupIdentifier , DragAndDropObserver } from 'vs/workbench/browser/dnd' ;
3131import { Color } from 'vs/base/common/color' ;
@@ -904,7 +904,7 @@ export class TabsTitleControl extends TitleControl {
904904 // Container
905905 addClass ( tabContainer , 'active' ) ;
906906 tabContainer . setAttribute ( 'aria-selected' , 'true' ) ;
907- tabContainer . style . backgroundColor = this . getColor ( TAB_ACTIVE_BACKGROUND ) ;
907+ tabContainer . style . backgroundColor = this . getColor ( isGroupActive ? TAB_ACTIVE_BACKGROUND : TAB_UNFOCUSED_ACTIVE_BACKGROUND ) ;
908908
909909 const activeTabBorderColorBottom = this . getColor ( isGroupActive ? TAB_ACTIVE_BORDER : TAB_UNFOCUSED_ACTIVE_BORDER ) ;
910910 if ( activeTabBorderColorBottom ) {
@@ -1245,35 +1245,29 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
12451245 adjustedTabDragBackground = editorGroupHeaderTabsBackground . flatten ( editorBackgroundColor , editorDragAndDropBackground , editorBackgroundColor , workbenchBackground ) ;
12461246 }
12471247
1248+ // Adjust gradient for focused and unfocused hover background
1249+ const makeTabHoverBackgroundRule = ( color : Color , colorDrag : Color , hasFocus = false ) => `
1250+ .monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container${ hasFocus ? '.active' : '' } > .title .tabs-container > .tab.sizing-shrink:not(.dragged):hover > .tab-label::after {
1251+ background: linear-gradient(to left, ${ color } , transparent) !important;
1252+ }
1253+
1254+ .monaco-workbench .part.editor > .content.dragged-over .editor-group-container${ hasFocus ? '.active' : '' } > .title .tabs-container > .tab.sizing-shrink:not(.dragged):hover > .tab-label::after {
1255+ background: linear-gradient(to left, ${ colorDrag } , transparent) !important;
1256+ }
1257+ ` ;
1258+
12481259 // Adjust gradient for (focused) hover background
12491260 if ( tabHoverBackground && adjustedTabBackground && adjustedTabDragBackground ) {
12501261 const adjustedColor = tabHoverBackground . flatten ( adjustedTabBackground ) ;
12511262 const adjustedColorDrag = tabHoverBackground . flatten ( adjustedTabDragBackground ) ;
1252- collector . addRule ( `
1253- .monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container.active > .title .tabs-container > .tab.sizing-shrink:not(.dragged):hover > .tab-label::after {
1254- background: linear-gradient(to left, ${ adjustedColor } , transparent) !important;
1255- }
1256-
1257-
1258- .monaco-workbench .part.editor > .content.dragged-over .editor-group-container.active > .title .tabs-container > .tab.sizing-shrink:not(.dragged):hover > .tab-label::after {
1259- background: linear-gradient(to left, ${ adjustedColorDrag } , transparent) !important;
1260- }
1261- ` ) ;
1263+ collector . addRule ( makeTabHoverBackgroundRule ( adjustedColor , adjustedColorDrag , true ) ) ;
12621264 }
12631265
12641266 // Adjust gradient for unfocused hover background
12651267 if ( tabUnfocusedHoverBackground && adjustedTabBackground && adjustedTabDragBackground ) {
12661268 const adjustedColor = tabUnfocusedHoverBackground . flatten ( adjustedTabBackground ) ;
12671269 const adjustedColorDrag = tabUnfocusedHoverBackground . flatten ( adjustedTabDragBackground ) ;
1268- collector . addRule ( `
1269- .monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container > .title .tabs-container > .tab.sizing-shrink:not(.dragged):hover > .tab-label::after {
1270- background: linear-gradient(to left, ${ adjustedColor } , transparent) !important;
1271- }
1272-
1273- .monaco-workbench .part.editor > .content.dragged-over .editor-group-container > .title .tabs-container > .tab.sizing-shrink:not(.dragged):hover > .tab-label::after {
1274- background: linear-gradient(to left, ${ adjustedColorDrag } , transparent) !important;
1275- }
1276- ` ) ;
1270+ collector . addRule ( makeTabHoverBackgroundRule ( adjustedColor , adjustedColorDrag ) ) ;
12771271 }
12781272
12791273 // Adjust gradient for drag and drop background
@@ -1287,20 +1281,31 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
12871281 ` ) ;
12881282 }
12891283
1290- // Adjust gradient for active tab background
1284+ // Adjust gradient for active tab background (focused and unfocused editor groups)
1285+ const makeTabActiveBackgroundRule = ( color : Color , colorDrag : Color , hasFocus = false ) => `
1286+ .monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container${ hasFocus ? '.active' : ':not(.active)' } > .title .tabs-container > .tab.sizing-shrink.active:not(.dragged) > .tab-label::after {
1287+ background: linear-gradient(to left, ${ color } , transparent);
1288+ }
1289+
1290+ .monaco-workbench .part.editor > .content.dragged-over .editor-group-container${ hasFocus ? '.active' : ':not(.active)' } > .title .tabs-container > .tab.sizing-shrink.active:not(.dragged) > .tab-label::after {
1291+ background: linear-gradient(to left, ${ colorDrag } , transparent);
1292+ }
1293+ ` ;
1294+
1295+ // Adjust gradient for unfocused active tab background
12911296 const tabActiveBackground = theme . getColor ( TAB_ACTIVE_BACKGROUND ) ;
12921297 if ( tabActiveBackground && adjustedTabBackground && adjustedTabDragBackground ) {
12931298 const adjustedColor = tabActiveBackground . flatten ( adjustedTabBackground ) ;
12941299 const adjustedColorDrag = tabActiveBackground . flatten ( adjustedTabDragBackground ) ;
1295- collector . addRule ( `
1296- .monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container > .title .tabs-container > .tab.sizing-shrink.active:not(.dragged) > .tab-label::after {
1297- background: linear-gradient(to left, ${ adjustedColor } , transparent);
1298- }
1300+ collector . addRule ( makeTabActiveBackgroundRule ( adjustedColor , adjustedColorDrag , true ) ) ;
1301+ }
12991302
1300- .monaco-workbench .part.editor > .content.dragged-over .editor-group-container > .title .tabs-container > .tab.sizing-shrink.active:not(.dragged) > .tab-label::after {
1301- background: linear-gradient(to left, ${ adjustedColorDrag } , transparent);
1302- }
1303- ` ) ;
1303+ // Adjust gradient for unfocused active tab background
1304+ const tabUnfocusedActiveBackground = theme . getColor ( TAB_UNFOCUSED_ACTIVE_BACKGROUND ) ;
1305+ if ( tabUnfocusedActiveBackground && adjustedTabBackground && adjustedTabDragBackground ) {
1306+ const adjustedColor = tabUnfocusedActiveBackground . flatten ( adjustedTabBackground ) ;
1307+ const adjustedColorDrag = tabUnfocusedActiveBackground . flatten ( adjustedTabDragBackground ) ;
1308+ collector . addRule ( makeTabActiveBackgroundRule ( adjustedColor , adjustedColorDrag ) ) ;
13041309 }
13051310
13061311 // Adjust gradient for inactive tab background
0 commit comments