Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: fixing the shortcut for opening the search area

Ilian Sapundshiev6e94f16ed22b
diff --git a/src/main/electron-menus.ts b/src/main/electron-menus.ts
index 79491baa5..282ea8035 100644
--- a/src/main/electron-menus.ts
+++ b/src/main/electron-menus.ts
@@ -118,6 +118,7 @@ export default function buildDesktopMenu(props: any, i18n) {
},
{
label: i18n.t('showSearch'),
+ accelerator: 'CmdOrCtrl+f',
click: props.openSearch,
},
{
diff --git a/src/renderer/containers/MainPage.tsx b/src/renderer/containers/MainPage.tsx
index 2fbd3d2ea..38a4e9733 100644
--- a/src/renderer/containers/MainPage.tsx
+++ b/src/renderer/containers/MainPage.tsx
@@ -16,35 +16,35 @@
*
*/
-import React, { useEffect, useReducer, useRef, useState } from 'react';
-import clsx from 'clsx';
-import { bindActionCreators } from 'redux';
-import { connect, useSelector } from 'react-redux';
+import AppConfig from '-/AppConfig';
+import PageNotification from '-/containers/PageNotification';
+import { FilePropertiesContextProvider } from '-/hooks/FilePropertiesContextProvider';
+import { FullScreenContextProvider } from '-/hooks/FullScreenContextProvider';
+import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
+import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';
+import { usePanelsContext } from '-/hooks/usePanelsContext';
+import { useUserContext } from '-/hooks/useUserContext';
+import useEventListener from '-/utils/useEventListener';
import { useMediaQuery } from '@mui/material';
-import SwipeableDrawer from '@mui/material/SwipeableDrawer';
import Drawer from '@mui/material/Drawer';
+import SwipeableDrawer from '@mui/material/SwipeableDrawer';
+import { styled, useTheme } from '@mui/material/styles';
+import { buffer } from '@tagspaces/tagspaces-common/misc';
+import clsx from 'clsx';
+import React, { useEffect, useReducer, useRef, useState } from 'react';
import { HotKeys } from 'react-hotkeys';
+import { connect, useSelector } from 'react-redux';
+import { bindActionCreators } from 'redux';
import { Split } from 'ts-react-splitter';
-import { buffer } from '@tagspaces/tagspaces-common/misc';
-import AppConfig from '-/AppConfig';
-import MobileNavigation from '../components/MobileNavigation';
-import FolderContainer from '../components/FolderContainer';
import EntryContainer from '../components/EntryContainer';
+import FolderContainer from '../components/FolderContainer';
+import MobileNavigation from '../components/MobileNavigation';
import {
+ actions as SettingsActions,
getDesktopMode,
getKeyBindingObject,
getMainVerticalSplitSize,
- actions as SettingsActions,
} from '../reducers/settings';
-import useEventListener from '-/utils/useEventListener';
-import PageNotification from '-/containers/PageNotification';
-import { styled, useTheme } from '@mui/material/styles';
-import { FilePropertiesContextProvider } from '-/hooks/FilePropertiesContextProvider';
-import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';
-import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
-import { usePanelsContext } from '-/hooks/usePanelsContext';
-import { useUserContext } from '-/hooks/useUserContext';
-import { FullScreenContextProvider } from '-/hooks/FullScreenContextProvider';
const drawerWidth = 320;
const body = document.getElementsByTagName('body')[0];
@@ -186,7 +186,11 @@ function MainPage(props: Props) {
showPanel('tagLibraryPanel');
setDrawerOpened(true);
},
- openSearch: () => enterSearchMode(),
+ openSearch: () => {
+ if (!isEntryInFullWidth) {
+ enterSearchMode();
+ }
+ },
closeSearch: () => {
exitSearchMode();
openCurrentDirectory();