TagSpaces is an offline, open source, document manager with tagging support
feat: added global shorkey for showing the search panel
Ilian Sapundshievb4d6cd412b55
diff --git a/app/main.dev.ts b/app/main.dev.tsindex fc3dbde88..1cb90588d 100644--- a/app/main.dev.ts+++ b/app/main.dev.ts@@ -255,6 +255,7 @@ app.on('ready', async () => {ipcMain.on('global-shortcuts-enabled', (e, globalShortcutsEnabled) => {if (globalShortcutsEnabled) {+ globalShortcut.register('CommandOrControl+Shift+F', showSearch);globalShortcut.register('CommandOrControl+Shift+P', resumePlayback);globalShortcut.register('MediaPlayPause', resumePlayback);globalShortcut.register('CommandOrControl+Shift+N', newTextFile);@@ -290,26 +291,30 @@ app.on('ready', async () => {mainWindow.restore();mainWindow.show();}- // mainWindow.webContents.send("showing-tagspaces", "tagspaces");+ }++ function showSearch() {+ if (mainWindow) {+ showTagSpaces();+ mainWindow.webContents.send('file', 'open-search');+ }}function newTextFile() {if (mainWindow) {- mainWindow.show();+ showTagSpaces();mainWindow.webContents.send('file', 'new-text-file');}}function getNextFile() {if (mainWindow) {- // mainWindow.show();mainWindow.webContents.send('file', 'next-file');}}function getPreviousFile() {if (mainWindow) {- // mainWindow.show();mainWindow.webContents.send('file', 'previous-file');}}diff --git a/app/services/electron-menus.ts b/app/services/electron-menus.tsindex cdba90541..0f2eba9ab 100644--- a/app/services/electron-menus.ts+++ b/app/services/electron-menus.ts@@ -38,6 +38,9 @@ export default function buildDesktopMenu(mainPageProps: any) {case 'new-text-file':mainPageProps.toggleCreateFileDialog();break;+ case 'open-search':+ mainPageProps.openSearchPanel();+ break;case 'audio':// console.log('showAudioRecordingDialog');break;diff --git a/app/services/electron-tray-menu.ts b/app/services/electron-tray-menu.tsindex fe4e852a6..59d340d02 100644--- a/app/services/electron-tray-menu.ts+++ b/app/services/electron-tray-menu.ts@@ -50,6 +50,10 @@ export default function buildTrayIconMenu(mainPageProps: any) {label: i18n.t('core:showTagSpaces') + cKey + '+Shift+W',click: PlatformIO.showMainWindow},+ {+ label: i18n.t('core:showSearch') + cKey + '+Shift+F',+ click: mainPageProps.openSearchPanel+ },{type: 'separator'},