@@ -11,6 +11,8 @@ import {
11
11
LayoutService ,
12
12
IBuiltinService ,
13
13
BuiltinService ,
14
+ ActivityBarService ,
15
+ IActivityBarService ,
14
16
} from 'mo/services' ;
15
17
import { ID_APP , ID_SIDE_BAR } from 'mo/common/id' ;
16
18
import { IMonacoService , MonacoService } from 'mo/monaco/monacoService' ;
@@ -41,6 +43,7 @@ export class MenuBarController
41
43
private readonly layoutService : ILayoutService ;
42
44
private readonly monacoService : IMonacoService ;
43
45
private readonly builtinService : IBuiltinService ;
46
+ private readonly activityBarService : IActivityBarService ;
44
47
private focusinEle : HTMLElement | null = null ;
45
48
46
49
private automation = { } ;
@@ -51,6 +54,7 @@ export class MenuBarController
51
54
this . layoutService = container . resolve ( LayoutService ) ;
52
55
this . monacoService = container . resolve ( MonacoService ) ;
53
56
this . builtinService = container . resolve ( BuiltinService ) ;
57
+ this . activityBarService = container . resolve ( ActivityBarService ) ;
54
58
}
55
59
56
60
public initView ( ) {
@@ -119,6 +123,9 @@ export class MenuBarController
119
123
*/
120
124
this . emit ( MenuBarEvent . onSelect , menuId ) ;
121
125
this . automation [ menuId ] ?.( ) ;
126
+
127
+ // Update the check status of MenuBar in the contextmenu of ActivityBar
128
+ this . updateActivityBarContextMenu ( menuId ) ;
122
129
} ;
123
130
124
131
public createFile = ( ) => {
@@ -271,4 +278,14 @@ export class MenuBarController
271
278
const menuBarData = this . getFilteredMenuBarData ( menuData , ids ) ;
272
279
return menuBarData ;
273
280
}
281
+
282
+ private updateActivityBarContextMenu ( menuId : UniqueId ) {
283
+ const {
284
+ MENU_VIEW_MENUBAR ,
285
+ CONTEXT_MENU_MENU ,
286
+ } = this . builtinService . getConstants ( ) ;
287
+ if ( CONTEXT_MENU_MENU && menuId === MENU_VIEW_MENUBAR ) {
288
+ this . activityBarService . toggleContextMenuChecked ( CONTEXT_MENU_MENU ) ;
289
+ }
290
+ }
274
291
}
0 commit comments