Skip to content

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

fix: displaying keybindings and zoom faktor

Ilian Sapundshiev2589419280de
diff --git a/release/app/package-lock.json b/release/app/package-lock.json
index 3b99206e8..eb98632c1 100644
--- a/release/app/package-lock.json
+++ b/release/app/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "tagspaces",
- "version": "5.7.0",
+ "version": "5.7.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "tagspaces",
- "version": "5.7.0",
+ "version": "5.7.1",
"hasInstallScript": true,
"license": "AGPL-3.0",
"dependencies": {
diff --git a/src/main/electron-tray-menu.ts b/src/main/electron-tray-menu.ts
index 9a9b43676..3487c98df 100644
--- a/src/main/electron-tray-menu.ts
+++ b/src/main/electron-tray-menu.ts
@@ -30,9 +30,9 @@ const icon2xWhite =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAACjAAAAowHwx5rOAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAA+FJREFUWIW1mV2IVVUUx/93ZjLTCDM0sDIqKY2G7AMq+0ChlCh8GAkCwUj7xPKhD4ueBgp6KRA0iKSggsAHw/BxqCfJIEoxMjKRKCU11KwpR7vdXw9rTnPuae919pm75w+HuXPOXmv/zt5rr732vS1AU6B+SdskrcrlsC+Xo5JakrYqI6Q0NaBvSXo0t9PcoK9LejqzT0l5QTdKejmjvy61Mi2mJyS9LYvPkL6T9Feir0WSZvzvLtDrNQS0iet9oK+Bv69CTnqd+uWSPpKlo5B2SFonqVO615K0QNLtkmYm99TDSC4BRp2RHAHOr9jcAOwptRkDXkwZ0clCLgZOOZC7gQsrNrOAnyvtOuN/H5sK0GuBow7kPuDigN2TkfYd4Ps60KYxeoWkEUmXRp4flMXtqcCzhRGbImYHvI6bgM6VQc6PPD8s6T5JR0v3zit9PhCxQ9IhSW2398TpnkX3IqjqOLCoYtMPbAfeAwaA2cAvgWkHWF839SmQM4BdDuRvwM0Bu82lNjuAC4BbgP2l++eAYaDVK+h04FMH8k/gzoDdcKDtbuASbHRvBO7FRjkp4XuQA+MjEdNZYEXA7jbH5hvgMqfPO4jk5phBH/Ch02EbeMixfxb4J2J7BBgM2NyKhVFQsY42xwywBbDOsS2uIeBMxMdJ4K5S28XACafPQ6EOXnMMAF5IgCxmZRnxUToDrAKuw99AfgKuqjrfUAM5nAi5EfgEyxiDwOGIv7bzIoy/wEKgK48+wkReC2lLIuTDTMTnF8Ac4GrggOM7pGPA9YXfcjx5NeUHpNWUS7GKqKwfgGuw1PR5IuSvWKX1n28B92OpJqaPsVRVBzmbeEV1BMudM4HPaiBPYIury3+fpKckTXN22YskTXf3YdNJSWsljQWezZO0S9JKWWET02lJKyTtDe3104BtNW/5JRZrKTG61BlZbw2MAnfH/BYf+oF3amC/BS5PAJ2Dv9JjkPd4fsv/tAjv0WX9iBXOMYfrsWS+BJgH7E2AHMPWiTsAoZsb8KfoGHBTwG41E2lpFKsD5gO/O77OAg/UQcZABawB/nY6+AOrfor2D2IlWxViP3GdA1amQHqgGncS26vBpmwIy68pU1xWG9sYkiDrQIsVfLqmw7XAXODrBpCrm0CmgAorv447HXeA57HjsVdkF20fbwqZCipsz62eyat6FStEskM2ARVwJXb+now6dB/gphRUNIvFsp7rBXIyoMJicaQB5Cu9Qk4WVNjRd2cC5HAOyF5AhdUH7zqQb+aC7BVUWH3wRgByU07IHKDF9VIJcivd33xkuXJ9hy9Jz0galBXi2X9l+xc7opIKau8a2gAAAABJRU5ErkJggg==';
export default function buildTrayIconMenu(mainPageProps: any, i18n, isMacLike) {
- const cKey = isMacLike ? ' - ⌘' : ' - Ctrl';
- const sKey = isMacLike ? '⇧' : 'Shift';
- const pKey = isMacLike ? ' ' : ' + ';
+ // const cKey = isMacLike ? ' - ⌘' : ' - Ctrl';
+ // const sKey = isMacLike ? '⇧' : 'Shift';
+ // const pKey = isMacLike ? ' ' : ' + ';
function openNextFile() {
mainPageProps.openNextFile();
@@ -59,44 +59,50 @@ export default function buildTrayIconMenu(mainPageProps: any, i18n, isMacLike) {
type: 'separator',
},
{
- label: i18n.t('showTagSpaces') + cKey + pKey + sKey + pKey + 'W',
- accelerator: 'Terd',
+ label: i18n.t('showTagSpaces'), // + cKey + pKey + sKey + pKey + 'W',
+ accelerator: 'CmdOrCtrl+Shift+w',
click: mainPageProps.showTagSpaces,
},
{
- label: i18n.t('showSearch') + cKey + pKey + sKey + pKey + 'F',
+ label: i18n.t('showSearch'), // + cKey + pKey + sKey + pKey + 'F',
+ accelerator: 'CmdOrCtrl+Shift+f',
click: mainPageProps.openSearch,
},
{
type: 'separator',
},
{
- label: i18n.t('newFileNote') + cKey + pKey + sKey + pKey + 'N',
+ label: i18n.t('newFileNote'), // + cKey + pKey + sKey + pKey + 'N',
+ accelerator: 'CmdOrCtrl+Shift+n',
click: mainPageProps.toggleNewFileDialog,
},
{
type: 'separator',
},
{
- label: i18n.t('openNextFileTooltip') + cKey + pKey + sKey + pKey + 'D',
+ label: i18n.t('openNextFileTooltip'), // + cKey + pKey + sKey + pKey + 'D',
+ accelerator: 'CmdOrCtrl+Shift+d',
click: openNextFile,
},
{
- label: i18n.t('openPrevFileTooltip') + cKey + pKey + sKey + pKey + 'A',
+ label: i18n.t('openPrevFileTooltip'), // + cKey + pKey + sKey + pKey + 'A',
+ accelerator: 'CmdOrCtrl+Shift+a',
click: openPrevFile,
},
{
type: 'separator',
},
{
- label: i18n.t('pauseResumePlayback') + cKey + pKey + sKey + pKey + 'P',
+ label: i18n.t('pauseResumePlayback'), // + cKey + pKey + sKey + pKey + 'P',
+ accelerator: 'CmdOrCtrl+Shift+p',
click: playResumePlayback,
},
{
type: 'separator',
},
{
- label: i18n.t('quitTagSpaces') + cKey + pKey + 'Q',
+ label: i18n.t('quitTagSpaces'), // + cKey + pKey + 'Q',
+ accelerator: 'CmdOrCtrl+q',
click: quitApp,
},
];
diff --git a/src/renderer/app.global.css b/src/renderer/app.global.css
index b5bd46ad7..16e2921a9 100644
--- a/src/renderer/app.global.css
+++ b/src/renderer/app.global.css
@@ -21,7 +21,7 @@ div[tabindex='-1']:focus {
html,
body {
overscroll-behavior-x: none;
- height: 100vh;
+ height: 100%;
position: absolute;
top: 0;
right: 0;
diff --git a/src/renderer/components/dialogs/KeyboardDialog.tsx b/src/renderer/components/dialogs/KeyboardDialog.tsx
index a0fa84f40..2e1246d39 100644
--- a/src/renderer/components/dialogs/KeyboardDialog.tsx
+++ b/src/renderer/components/dialogs/KeyboardDialog.tsx
@@ -17,7 +17,6 @@
*/
import React from 'react';
-import { styled } from '@mui/material/styles';
import { useSelector } from 'react-redux';
import Button from '@mui/material/Button';
import DialogActions from '@mui/material/DialogActions';
@@ -33,22 +32,21 @@ import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import { useTranslation } from 'react-i18next';
+import AppConfig from '-/AppConfig';
-const PREFIX = 'KeyboardDialog';
-
-const classes = {
- shortcutKey: `${PREFIX}-shortcutKey`,
-};
-
-const StyledDialog = styled(Dialog)(({ theme }) => ({
- [`& .${classes.shortcutKey}`]: {
- backgroundColor: theme.palette.primary.main,
- font: 'Console',
- fontFamily: 'monospace',
- padding: '5px',
- borderRadius: '5px',
- },
-}));
+export function adjustKeyBinding(keyBinding: string) {
+ let adjKB = keyBinding;
+ if (AppConfig.isMacLike) {
+ adjKB = adjKB
+ .replace('+', ' ')
+ .replace('command', '⌘')
+ .replace('shift', '')
+ .toUpperCase();
+ } else {
+ adjKB = adjKB.replace('+', ' + ').toUpperCase();
+ }
+ return adjKB;
+}
interface Props {
open: boolean;
@@ -63,7 +61,7 @@ function KeyboardDialog(props: Props) {
const theme = useTheme();
const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
return (
- <StyledDialog
+ <Dialog
open={open}
onClose={onClose}
fullScreen={fullScreen}
@@ -86,8 +84,17 @@ function KeyboardDialog(props: Props) {
Object.keys(keyBindings).map((shortcutKey) => (
<ListItem key={shortcutKey}>
<ListItemText primary={t('core:' + shortcutKey)} />
- <ListItemSecondaryAction className={classes.shortcutKey}>
- {keyBindings[shortcutKey].toUpperCase()}
+ <ListItemSecondaryAction
+ style={{
+ backgroundColor: 'gray',
+ color: 'white',
+ font: 'Console',
+ fontFamily: 'monospace',
+ padding: '5px',
+ borderRadius: '5px',
+ }}
+ >
+ {adjustKeyBinding(keyBindings[shortcutKey])}
</ListItemSecondaryAction>
</ListItem>
))}
@@ -105,7 +112,7 @@ function KeyboardDialog(props: Props) {
{t('core:ok')}
</Button>
</DialogActions>
- </StyledDialog>
+ </Dialog>
);
}
diff --git a/src/renderer/components/menus/MenuKeyBinding.tsx b/src/renderer/components/menus/MenuKeyBinding.tsx
index 0ad14d966..bedbccf4c 100644
--- a/src/renderer/components/menus/MenuKeyBinding.tsx
+++ b/src/renderer/components/menus/MenuKeyBinding.tsx
@@ -18,29 +18,21 @@
import React from 'react';
import Typography from '@mui/material/Typography';
-import AppConfig from '-/AppConfig';
+import { adjustKeyBinding } from '-/components/dialogs/KeyboardDialog';
interface Props {
keyBinding?: string;
}
function MenuKeyBinding(props: Props) {
- let adjKB = props.keyBinding;
- if (AppConfig.isMacLike) {
- adjKB = adjKB
- .replace('+', ' ')
- .replace('command', '⌘')
- .replace('shift', '');
- } else {
- adjKB = adjKB.replace('+', ' + ');
- }
+ let keyBinding = props.keyBinding;
return (
<Typography
variant="body2"
color="text.secondary"
style={{ textTransform: 'uppercase' }}
>
- {adjKB}
+ {adjustKeyBinding(keyBinding)}
</Typography>
);
}
diff --git a/src/renderer/containers/MainPage.tsx b/src/renderer/containers/MainPage.tsx
index 64281d03d..501c78c91 100644
--- a/src/renderer/containers/MainPage.tsx
+++ b/src/renderer/containers/MainPage.tsx
@@ -715,6 +715,7 @@ function MainPage(props: Props) {
>
<style>
{`
+ html { zoom: 0.9 }
body { background-color: ${
theme.palette.background.default
} !important;}