/
githubmirror
/
marktext
Обзор
Документация
Войти
/
githubmirror
/
marktext
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/desktop/src/main/menu/templates/marktext.ts
73 строки
2 KB
Ran Luo
chore: convert repo to pnpm monorepo (packages/desktop, muyajs, website) (#4302)
29 май 2026, 05:25
Не верифицирован
29 май 2026, 05:25
565bfcd
Код
Авторство
О чём код?
import { app, type BrowserWindow, type MenuItemConstructorOptions } from 'electron' import { showAboutDialog } from '../actions/help' import * as actions from '../actions/marktext' import { t } from '../../i18n' import type Keybindings from '../../keyboard/shortcutHandler' // macOS only menu. export default function(keybindings: Keybindings): MenuItemConstructorOptions { return { label: t('menu.marktext.title'), submenu: [ { label: t('menu.marktext.about'), click(_menuItem, focusedWindow) { showAboutDialog(focusedWindow as BrowserWindow | undefined) } }, { label: t('menu.marktext.checkUpdates'), click(_menuItem, focusedWindow) { actions.checkUpdates((focusedWindow as BrowserWindow | undefined) ?? null) } }, { label: t('menu.marktext.preferences'), accelerator: keybindings.getAccelerator('file.preferences') ?? undefined, click() { actions.userSetting() } }, { type: 'separator' }, { label: t('menu.marktext.services'), role: 'services', submenu: [] }, { type: 'separator' }, { label: t('menu.marktext.hide'), accelerator: keybindings.getAccelerator('mt.hide') ?? undefined, click() { actions.osxHide() } }, { label: t('menu.marktext.hideOthers'), accelerator: keybindings.getAccelerator('mt.hide-others') ?? undefined, click() { actions.osxHideAll() } }, { label: t('menu.marktext.showAll'), click() { actions.osxShowAll() } }, { type: 'separator' }, { label: t('menu.marktext.quit'), accelerator: keybindings.getAccelerator('file.quit') ?? undefined, click: app.quit } ] } }