@@ -34,7 +34,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
3434import { MergeGroupMode , IMergeGroupOptions , GroupsArrangement , IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService' ;
3535import { addDisposableListener , EventType , EventHelper , Dimension , scheduleAtNextAnimationFrame , findParentWithClass , clearNode } from 'vs/base/browser/dom' ;
3636import { localize } from 'vs/nls' ;
37- import { IEditorGroupsAccessor , IEditorGroupView , EditorServiceImpl , EDITOR_TITLE_HEIGHT } from 'vs/workbench/browser/parts/editor/editor' ;
37+ import { IEditorGroupsAccessor , IEditorGroupView , EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor' ;
3838import { CloseOneEditorAction , UnpinEditorAction } from 'vs/workbench/browser/parts/editor/editorActions' ;
3939import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
4040import { BreadcrumbsControl } from 'vs/workbench/browser/parts/editor/breadcrumbsControl' ;
@@ -64,12 +64,14 @@ export class TabsTitleControl extends TitleControl {
6464 large : 10
6565 } ;
6666
67- private static readonly TAB_SIZES = {
67+ private static readonly TAB_WIDTH = {
6868 compact : 38 ,
6969 shrink : 80 ,
7070 fit : 120
7171 } ;
7272
73+ private static readonly TAB_HEIGHT = 35 ;
74+
7375 private titleContainer : HTMLElement | undefined ;
7476 private tabsAndActionsContainer : HTMLElement | undefined ;
7577 private tabsContainer : HTMLElement | undefined ;
@@ -509,6 +511,11 @@ export class TabsTitleControl extends TitleControl {
509511 this . computeTabLabels ( ) ;
510512 }
511513
514+ // Update tabs scrollbar sizing
515+ if ( oldOptions . titleScrollbarSizing !== newOptions . titleScrollbarSizing ) {
516+ this . updateTabsScrollbarSizing ( ) ;
517+ }
518+
512519 // Redraw tabs when other options change
513520 if (
514521 oldOptions . labelFormat !== newOptions . labelFormat ||
@@ -521,11 +528,6 @@ export class TabsTitleControl extends TitleControl {
521528 ) {
522529 this . redraw ( ) ;
523530 }
524-
525- // Udate tabs scrollbar sizing
526- if ( oldOptions . titleScrollbarSizing !== newOptions . titleScrollbarSizing ) {
527- this . updateTabsScrollbarSizing ( ) ;
528- }
529531 }
530532
531533 updateStyles ( ) : void {
@@ -1065,10 +1067,10 @@ export class TabsTitleControl extends TitleControl {
10651067 let stickyTabWidth = 0 ;
10661068 switch ( options . pinnedTabSizing ) {
10671069 case 'compact' :
1068- stickyTabWidth = TabsTitleControl . TAB_SIZES . compact ;
1070+ stickyTabWidth = TabsTitleControl . TAB_WIDTH . compact ;
10691071 break ;
10701072 case 'shrink' :
1071- stickyTabWidth = TabsTitleControl . TAB_SIZES . shrink ;
1073+ stickyTabWidth = TabsTitleControl . TAB_WIDTH . shrink ;
10721074 break ;
10731075 }
10741076
@@ -1221,7 +1223,12 @@ export class TabsTitleControl extends TitleControl {
12211223 }
12221224
12231225 getPreferredHeight ( ) : number {
1224- return EDITOR_TITLE_HEIGHT + ( this . breadcrumbsControl && ! this . breadcrumbsControl . isHidden ( ) ? BreadcrumbsControl . HEIGHT : 0 ) ;
1226+ let height = TabsTitleControl . TAB_HEIGHT ;
1227+ if ( this . breadcrumbsControl && ! this . breadcrumbsControl . isHidden ( ) ) {
1228+ height += BreadcrumbsControl . HEIGHT ;
1229+ }
1230+
1231+ return height ;
12251232 }
12261233
12271234 layout ( dimension : Dimension | undefined ) : void {
@@ -1299,10 +1306,10 @@ export class TabsTitleControl extends TitleControl {
12991306 let stickyTabWidth = 0 ;
13001307 switch ( this . accessor . partOptions . pinnedTabSizing ) {
13011308 case 'compact' :
1302- stickyTabWidth = TabsTitleControl . TAB_SIZES . compact ;
1309+ stickyTabWidth = TabsTitleControl . TAB_WIDTH . compact ;
13031310 break ;
13041311 case 'shrink' :
1305- stickyTabWidth = TabsTitleControl . TAB_SIZES . shrink ;
1312+ stickyTabWidth = TabsTitleControl . TAB_WIDTH . shrink ;
13061313 break ;
13071314 }
13081315
@@ -1314,7 +1321,7 @@ export class TabsTitleControl extends TitleControl {
13141321 // Special case: we have sticky tabs but the available space for showing tabs
13151322 // is little enough that we need to disable sticky tabs sticky positioning
13161323 // so that tabs can be scrolled at naturally.
1317- if ( this . group . stickyCount > 0 && availableTabsContainerWidth < TabsTitleControl . TAB_SIZES . fit ) {
1324+ if ( this . group . stickyCount > 0 && availableTabsContainerWidth < TabsTitleControl . TAB_WIDTH . fit ) {
13181325 tabsContainer . classList . add ( 'disable-sticky-tabs' ) ;
13191326
13201327 availableTabsContainerWidth = visibleTabsContainerWidth ;
0 commit comments