Skip to content

Commit d04cd16

Browse files
committed
feat(menu): add presentation mode to main menu
1 parent 1b2a170 commit d04cd16

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/main/menu/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,14 @@ const markdownMenuItems: MenuConfig[] = [
204204
click: () => send('main-menu:preview-mindmap'),
205205
accelerator: 'CommandOrControl+Shift+I',
206206
},
207+
{
208+
type: 'separator',
209+
},
210+
{
211+
label: i18n.t('menu:markdown.presentationMode'),
212+
click: () => send('main-menu:presentation-mode'),
213+
accelerator: 'CommandOrControl+Shift+P',
214+
},
207215
]
208216

209217
const menuItems: MenuItemConstructorOptions[] = [

src/main/types/ipc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type MainMenuAction =
1818
| 'preview-markdown'
1919
| 'preview-mindmap'
2020
| 'preview-code'
21+
| 'presentation-mode'
2122

2223
type DBAction = 'relaod' | 'move' | 'migrate' | 'clear'
2324
type SystemAction = 'reload' | 'open-external'

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

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

55
const { createSnippetAndSelect, addFragment } = useSnippets()
66
const { createFolderAndSelect } = useFolders()
7-
const { isShowMarkdown, isShowMindmap, isShowCodePreview } = useApp()
7+
const {
8+
isShowMarkdown,
9+
isShowMindmap,
10+
isShowCodePreview,
11+
isShowMarkdownPresentation,
12+
} = useApp()
813

914
export function registerMainMenuListeners() {
1015
ipc.on('main-menu:goto-preferences', () => {
@@ -34,4 +39,9 @@ export function registerMainMenuListeners() {
3439
ipc.on('main-menu:preview-code', () => {
3540
isShowCodePreview.value = !isShowCodePreview.value
3641
})
42+
43+
ipc.on('main-menu:presentation-mode', () => {
44+
isShowMarkdownPresentation.value = !isShowMarkdownPresentation.value
45+
router.push({ name: RouterName.markdownPresentation })
46+
})
3747
}

0 commit comments

Comments
 (0)