diff --git a/src/main/menu.ts b/src/main/menu.ts index 8ee3aa2a84..f5a11f1cfd 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import electron, { BrowserWindow } from 'electron'; +import electron, { BrowserWindow, MenuItem, MenuItemConstructorOptions } from 'electron'; import { t } from 'i18next'; import { homepage, getReleaseUrl, licensesPage } from './constants.js'; @@ -15,8 +15,8 @@ const { Menu } = electron; export default ({ app, mainWindow, newVersion, isStoreBuild }: { app: Electron.App, mainWindow: BrowserWindow, newVersion?: string | undefined, isStoreBuild: boolean, }) => { - const menu = [ - ...(process.platform === 'darwin' ? [{ role: 'appMenu' }] : []), + const menu: (MenuItemConstructorOptions | MenuItem)[] = [ + ...(process.platform === 'darwin' ? [{ role: 'appMenu' as const }] : []), { label: esc(t('File')), @@ -192,7 +192,7 @@ export default ({ app, mainWindow, newVersion, isStoreBuild }: { // Due to Apple Review Guidelines, we cannot include an Exit menu item here // Apple has their own Quit from the app menu ...(process.platform !== 'darwin' ? [ - { type: 'separator' }, + { type: 'separator' } as const, { label: esc(t('Exit')), click() { @@ -214,7 +214,7 @@ export default ({ app, mainWindow, newVersion, isStoreBuild }: { { role: 'cut', label: esc(t('Cut')) }, { role: 'copy', label: esc(t('Copy')) }, { role: 'paste', label: esc(t('Paste')) }, - { role: 'selectall', label: esc(t('Select All')) }, + { role: 'selectAll', label: esc(t('Select All')) }, { type: 'separator' }, { label: esc(t('Tracks')), @@ -336,15 +336,18 @@ export default ({ app, mainWindow, newVersion, isStoreBuild }: { label: esc(t('View')), submenu: [ { role: 'togglefullscreen', label: esc(t('Toggle Full Screen')) }, + { role: 'resetZoom', label: esc(t('Reset font size')) }, + { role: 'zoomIn', label: esc(t('Increase font size')) }, + { role: 'zoomOut', label: esc(t('Decrease font size')) }, ], }, // On Windows the windowMenu has a close Ctrl+W which clashes with File->Close shortcut ...(process.platform === 'darwin' - ? [{ role: 'windowMenu', label: esc(t('Window')) }] + ? [{ role: 'windowMenu' as const, label: esc(t('Window')) }] : [{ label: esc(t('Window')), - submenu: [{ role: 'minimize', label: esc(t('Minimize')) }], + submenu: [{ role: 'minimize' as const, label: esc(t('Minimize')) }], }] ), @@ -440,7 +443,7 @@ export default ({ app, mainWindow, newVersion, isStoreBuild }: { label: esc(t('Licenses')), click() { electron.shell.openExternal(licensesPage); }, }, - ...(process.platform !== 'darwin' ? [{ role: 'about', label: esc(t('About LosslessCut')) }] : []), + ...(process.platform !== 'darwin' ? [{ role: 'about' as const, label: esc(t('About LosslessCut')) }] : []), ], }, ]; @@ -457,6 +460,5 @@ export default ({ app, mainWindow, newVersion, isStoreBuild }: { }); } - // @ts-expect-error todo Menu.setApplicationMenu(Menu.buildFromTemplate(menu)); }; diff --git a/src/renderer/src/NoFileLoaded.tsx b/src/renderer/src/NoFileLoaded.tsx index 4412c86db7..f4d1fe0ed3 100644 --- a/src/renderer/src/NoFileLoaded.tsx +++ b/src/renderer/src/NoFileLoaded.tsx @@ -17,21 +17,21 @@ const NoFileLoaded = memo(({ mifiLink, currentCutSeg, onClick, darkMode }: { return (
-
{t('DROP FILE(S)')}
+
{t('DROP FILE(S)')}
-
+
See Help menu for help
-
+
or I O to set cutpoints
-
e.stopPropagation()}> +
e.stopPropagation()}> {simpleMode ? ( to show advanced view ) : ( @@ -40,7 +40,7 @@ const NoFileLoaded = memo(({ mifiLink, currentCutSeg, onClick, darkMode }: {
{mifiLink && typeof mifiLink === 'object' && 'loadUrl' in mifiLink && typeof mifiLink.loadUrl === 'string' && mifiLink.loadUrl ? ( -
+