File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
workbench/browser/parts/titlebar Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -746,7 +746,7 @@ export class MenuBar extends Disposable {
746
746
this . _onFocusStateChange . fire ( this . focusState >= MenubarState . FOCUSED ) ;
747
747
}
748
748
749
- private get isVisible ( ) : boolean {
749
+ get isVisible ( ) : boolean {
750
750
return this . focusState >= MenubarState . VISIBLE ;
751
751
}
752
752
Original file line number Diff line number Diff line change @@ -698,6 +698,11 @@ export class CustomMenubarControl extends MenubarControl {
698
698
} ) ) ;
699
699
700
700
this . reinstallDisposables . add ( attachMenuStyler ( this . menubar , this . themeService ) ) ;
701
+
702
+ // Fire visibility change for the first install if menu is shown
703
+ if ( this . menubar . isVisible ) {
704
+ this . onDidVisibilityChange ( true ) ;
705
+ }
701
706
} else {
702
707
this . menubar ?. update ( this . getMenuBarOptions ( ) ) ;
703
708
}
Original file line number Diff line number Diff line change @@ -180,7 +180,9 @@ export class TitlebarPart extends Part implements ITitleService {
180
180
181
181
protected onMenubarVisibilityChanged ( visible : boolean ) : void {
182
182
if ( isWeb || isWindows || isLinux ) {
183
- this . adjustTitleMarginToCenter ( ) ;
183
+ if ( this . lastLayoutDimensions ) {
184
+ this . layout ( this . lastLayoutDimensions . width , this . lastLayoutDimensions . height ) ;
185
+ }
184
186
185
187
this . _onMenubarVisibilityChange . fire ( visible ) ;
186
188
}
@@ -197,6 +199,8 @@ export class TitlebarPart extends Part implements ITitleService {
197
199
this . menubar . remove ( ) ;
198
200
this . menubar = undefined ;
199
201
}
202
+
203
+ this . onMenubarVisibilityChanged ( false ) ;
200
204
}
201
205
202
206
protected installMenubar ( ) : void {
@@ -210,9 +214,9 @@ export class TitlebarPart extends Part implements ITitleService {
210
214
this . menubar = this . rootContainer . insertBefore ( $ ( 'div.menubar' ) , this . title ) ;
211
215
this . menubar . setAttribute ( 'role' , 'menubar' ) ;
212
216
213
- this . customMenubar . create ( this . menubar ) ;
214
-
215
217
this . _register ( this . customMenubar . onVisibilityChange ( e => this . onMenubarVisibilityChanged ( e ) ) ) ;
218
+
219
+ this . customMenubar . create ( this . menubar ) ;
216
220
}
217
221
218
222
private updateTitle ( ) : void {
You can’t perform that action at this time.
0 commit comments