@@ -50,8 +50,9 @@ export class TitlebarPart extends Part implements ITitleService {
50
50
readonly maximumWidth : number = Number . POSITIVE_INFINITY ;
51
51
get minimumHeight ( ) : number {
52
52
const value = this . isCommandCenterVisible ? 35 : 30 ;
53
- return value / ( this . currentMenubarVisibility === 'hidden' || getZoomFactor ( ) < 1 ? getZoomFactor ( ) : 1 ) ;
53
+ return value / ( this . useCounterZoom ? getZoomFactor ( ) : 1 ) ;
54
54
}
55
+
55
56
get maximumHeight ( ) : number { return this . minimumHeight ; }
56
57
57
58
//#endregion
@@ -159,6 +160,7 @@ export class TitlebarPart extends Part implements ITitleService {
159
160
160
161
if ( this . titleBarStyle !== 'native' && this . layoutControls && event . affectsConfiguration ( 'workbench.layoutControl.enabled' ) ) {
161
162
this . layoutControls . classList . toggle ( 'show-layout-control' , this . layoutControlEnabled ) ;
163
+ this . _onDidChange . fire ( undefined ) ;
162
164
}
163
165
164
166
if ( event . affectsConfiguration ( TitlebarPart . configCommandCenter ) ) {
@@ -438,17 +440,26 @@ export class TitlebarPart extends Part implements ITitleService {
438
440
return this . configurationService . getValue < boolean > ( 'workbench.layoutControl.enabled' ) ;
439
441
}
440
442
443
+ protected get useCounterZoom ( ) : boolean {
444
+ // Prevent zooming behavior if any of the following conditions are met:
445
+ // 1. Shrinking below the window control size (zoom < 1)
446
+ // 2. No custom items are present in the title bar
447
+ const zoomFactor = getZoomFactor ( ) ;
448
+
449
+ const noMenubar = this . currentMenubarVisibility === 'hidden' || ( ! isWeb && isMacintosh ) ;
450
+ const noCommandCenter = ! this . isCommandCenterVisible ;
451
+ const noLayoutControls = ! this . layoutControlEnabled ;
452
+ return zoomFactor < 1 || ( noMenubar && noCommandCenter && noLayoutControls ) ;
453
+ }
454
+
441
455
updateLayout ( dimension : Dimension ) : void {
442
456
this . lastLayoutDimensions = dimension ;
443
457
444
458
if ( getTitleBarStyle ( this . configurationService ) === 'custom' ) {
445
- // Prevent zooming behavior if any of the following conditions are met:
446
- // 1. Native macOS
447
- // 2. Menubar is hidden
448
- // 3. Shrinking below the window control size (zoom < 1)
449
459
const zoomFactor = getZoomFactor ( ) ;
460
+
450
461
this . element . style . setProperty ( '--zoom-factor' , zoomFactor . toString ( ) ) ;
451
- this . rootContainer . classList . toggle ( 'counter-zoom' , zoomFactor < 1 || ( ! isWeb && isMacintosh ) || this . currentMenubarVisibility === 'hidden' ) ;
462
+ this . rootContainer . classList . toggle ( 'counter-zoom' , this . useCounterZoom ) ;
452
463
453
464
runAtThisOrScheduleAtNextAnimationFrame ( ( ) => this . adjustTitleMarginToCenter ( ) ) ;
454
465
0 commit comments