@@ -18,7 +18,7 @@ import { inject, injectable, postConstruct } from 'inversify';
18
18
import { Command , CommandContribution , CommandRegistry , isOSX , isWindows , MenuModelRegistry , MenuContribution , Disposable , nls } from '../../common' ;
19
19
import {
20
20
codicon , ConfirmDialog , KeybindingContribution , KeybindingRegistry , PreferenceScope , Widget ,
21
- FrontendApplication , FrontendApplicationContribution , CommonMenus , CommonCommands , Dialog , Message , ApplicationShell ,
21
+ FrontendApplication , FrontendApplicationContribution , CommonMenus , CommonCommands , Dialog , Message , ApplicationShell , PreferenceService , animationFrame ,
22
22
} from '../../browser' ;
23
23
import { ElectronMainMenuFactory } from './electron-main-menu-factory' ;
24
24
import { FrontendApplicationStateService , FrontendApplicationState } from '../../browser/frontend-application-state' ;
@@ -441,6 +441,9 @@ export class CustomTitleWidget extends Widget {
441
441
@inject ( ApplicationShell )
442
442
protected readonly applicationShell : ApplicationShell ;
443
443
444
+ @inject ( PreferenceService )
445
+ protected readonly preferenceService : PreferenceService ;
446
+
444
447
constructor ( ) {
445
448
super ( ) ;
446
449
this . id = 'theia-custom-title' ;
@@ -452,6 +455,11 @@ export class CustomTitleWidget extends Widget {
452
455
this . windowTitleService . onDidChangeTitle ( title => {
453
456
this . updateTitle ( title ) ;
454
457
} ) ;
458
+ this . preferenceService . onPreferenceChanged ( e => {
459
+ if ( e . preferenceName === 'window.menuBarVisibility' ) {
460
+ animationFrame ( ) . then ( ( ) => this . adjustTitleToCenter ( ) ) ;
461
+ }
462
+ } ) ;
455
463
}
456
464
457
465
protected override onResize ( msg : Widget . ResizeMessage ) : void {
0 commit comments