@@ -37,19 +37,18 @@ export function createAndFillInContextMenuActions(menu: IMenu, options: IMenuAct
37
37
fillInActions ( groups , target , useAlternativeActions , primaryGroup ? actionGroup => actionGroup === primaryGroup : actionGroup => actionGroup === 'navigation' ) ;
38
38
}
39
39
40
- export function createAndFillInActionBarActions ( menu : IMenu , options : IMenuActionOptions | undefined , target : IAction [ ] | { primary : IAction [ ] ; secondary : IAction [ ] } , primaryGroup ?: string | ( ( actionGroup : string ) => boolean ) , primaryMaxCount ?: number , shouldInlineSubmenu ?: ( action : SubmenuAction , group : string , groupSize : number ) => boolean , useSeparatorsInPrimaryActions ?: boolean ) : void {
40
+ export function createAndFillInActionBarActions ( menu : IMenu , options : IMenuActionOptions | undefined , target : IAction [ ] | { primary : IAction [ ] ; secondary : IAction [ ] } , primaryGroup ?: string | ( ( actionGroup : string ) => boolean ) , shouldInlineSubmenu ?: ( action : SubmenuAction , group : string , groupSize : number ) => boolean , useSeparatorsInPrimaryActions ?: boolean ) : void {
41
41
const groups = menu . getActions ( options ) ;
42
42
const isPrimaryAction = typeof primaryGroup === 'string' ? ( actionGroup : string ) => actionGroup === primaryGroup : primaryGroup ;
43
43
44
44
// Action bars handle alternative actions on their own so the alternative actions should be ignored
45
- fillInActions ( groups , target , false , isPrimaryAction , primaryMaxCount , shouldInlineSubmenu , useSeparatorsInPrimaryActions ) ;
45
+ fillInActions ( groups , target , false , isPrimaryAction , shouldInlineSubmenu , useSeparatorsInPrimaryActions ) ;
46
46
}
47
47
48
48
function fillInActions (
49
49
groups : ReadonlyArray < [ string , ReadonlyArray < MenuItemAction | SubmenuItemAction > ] > , target : IAction [ ] | { primary : IAction [ ] ; secondary : IAction [ ] } ,
50
50
useAlternativeActions : boolean ,
51
51
isPrimaryAction : ( actionGroup : string ) => boolean = actionGroup => actionGroup === 'navigation' ,
52
- primaryMaxCount : number = Number . MAX_SAFE_INTEGER ,
53
52
shouldInlineSubmenu : ( action : SubmenuAction , group : string , groupSize : number ) => boolean = ( ) => false ,
54
53
useSeparatorsInPrimaryActions : boolean = false
55
54
) : void {
@@ -101,16 +100,10 @@ function fillInActions(
101
100
// inlining submenus with length 0 or 1 is easy,
102
101
// larger submenus need to be checked with the overall limit
103
102
const submenuActions = action . actions ;
104
- if ( ( submenuActions . length <= 1 || target . length + submenuActions . length - 2 <= primaryMaxCount ) && shouldInlineSubmenu ( action , group , target . length ) ) {
103
+ if ( submenuActions . length <= 1 && shouldInlineSubmenu ( action , group , target . length ) ) {
105
104
target . splice ( index , 1 , ...submenuActions ) ;
106
105
}
107
106
}
108
-
109
- // overflow items from the primary group into the secondary bucket
110
- if ( primaryBucket !== secondaryBucket && primaryBucket . length > primaryMaxCount ) {
111
- const overflow = primaryBucket . splice ( primaryMaxCount , primaryBucket . length - primaryMaxCount ) ;
112
- secondaryBucket . unshift ( ...overflow , new Separator ( ) ) ;
113
- }
114
107
}
115
108
116
109
export interface IMenuEntryActionViewItemOptions {
0 commit comments