Skip to content

Commit b12ae39

Browse files
committed
feat(menu): add mindmap preview option to main menu
1 parent d7871aa commit b12ae39

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/main/menu/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ const markdownMenuItems: MenuConfig[] = [
194194
click: () => send('main-menu:preview-markdown'),
195195
accelerator: 'CommandOrControl+Shift+M',
196196
},
197+
{
198+
label: i18n.t('menu:markdown.previewMindmap'),
199+
click: () => send('main-menu:preview-mindmap'),
200+
accelerator: 'CommandOrControl+Shift+I',
201+
},
197202
]
198203

199204
const menuItems: MenuItemConstructorOptions[] = [

src/main/types/ipc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type MainMenuAction =
1616
| 'new-snippet'
1717
| 'open-dialog'
1818
| 'preview-markdown'
19+
| 'preview-mindmap'
1920

2021
type DBAction = 'relaod' | 'move' | 'migrate' | 'clear'
2122
type SystemAction = 'reload' | 'open-external'

src/renderer/ipc/listeners/main-menu.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { router } from '@/router'
44

55
const { createSnippetAndSelect, addFragment } = useSnippets()
66
const { createFolderAndSelect } = useFolders()
7-
const { isShowMarkdown } = useApp()
7+
const { isShowMarkdown, isShowMindmap } = useApp()
88

99
export function registerMainMenuListeners() {
1010
ipc.on('main-menu:goto-preferences', () => {
@@ -26,4 +26,8 @@ export function registerMainMenuListeners() {
2626
ipc.on('main-menu:preview-markdown', () => {
2727
isShowMarkdown.value = !isShowMarkdown.value
2828
})
29+
30+
ipc.on('main-menu:preview-mindmap', () => {
31+
isShowMindmap.value = !isShowMindmap.value
32+
})
2933
}

0 commit comments

Comments
 (0)