MCPcopy Index your code
hub / github.com/massCodeIO/massCode / createViewMenuItems

Function createViewMenuItems

src/main/menu/main.ts:430–479  ·  view source on GitHub ↗
(context: MainMenuContext)

Source from the content-addressed store, hash-verified

428}
429
430function createViewMenuItems(context: MainMenuContext): MenuConfig[] {
431 const items = createLayoutMenuItems(context)
432 const sortItems = createSortMenuItems(context)
433
434 if (sortItems.length) {
435 if (items.length) {
436 items.push({ type: 'separator' })
437 }
438
439 items.push(...sortItems)
440 }
441
442 if (context.view.canToggleCompactMode) {
443 if (items.length) {
444 items.push({ type: 'separator' })
445 }
446
447 items.push({
448 label: i18n.t('menu:view.compactMode'),
449 type: 'checkbox',
450 checked: context.view.isCompactMode,
451 click: () => send('main-menu:toggle-compact-mode'),
452 })
453 }
454
455 if (context.view.canToggleMindmap || context.view.canTogglePresentation) {
456 if (items.length) {
457 items.push({ type: 'separator' })
458 }
459
460 items.push({
461 label: i18n.t('menu:markdown.previewMindmap'),
462 type: 'checkbox',
463 enabled: context.view.canToggleMindmap,
464 checked: context.view.isMindmapShown,
465 click: () => send('main-menu:preview-mindmap'),
466 accelerator: 'CommandOrControl+Shift+I',
467 })
468 items.push({
469 label: i18n.t('menu:markdown.presentationMode'),
470 type: 'checkbox',
471 enabled: context.view.canTogglePresentation,
472 checked: context.view.isPresentationShown,
473 click: () => send('main-menu:presentation-mode'),
474 accelerator: 'CommandOrControl+Shift+P',
475 })
476 }
477
478 return items
479}
480
481function createHistoryMenuItems(): MenuConfig[] {
482 return [

Callers 1

createMainMenuTemplateFunction · 0.85

Calls 3

sendFunction · 0.90
createLayoutMenuItemsFunction · 0.85
createSortMenuItemsFunction · 0.85

Tested by

no test coverage detected