TagSpaces is an offline, open source, document manager with tagging support
feat: adding parameter in extconfig for hiding logo and version
Ilian Sapundshievdfac724eaabf
diff --git a/src/renderer/AppConfig.ts b/src/renderer/AppConfig.tsindex c36448732..51681e452 100644--- a/src/renderer/AppConfig.ts+++ b/src/renderer/AppConfig.ts@@ -179,4 +179,10 @@ AppConfig.defaultMapBounds =northEast: { lat: 29, lng: 50 },};+AppConfig.showTSLogo =+ typeof window !== 'undefined' && (window.ExtShowTSLogo || true);++AppConfig.showTSVersion =+ typeof window !== 'undefined' && (window.ExtShowTSVersion || true);+export default AppConfig;diff --git a/src/renderer/components/CustomLogo.tsx b/src/renderer/components/CustomLogo.tsxindex 6c57d0eba..e160d8ce6 100644--- a/src/renderer/components/CustomLogo.tsx+++ b/src/renderer/components/CustomLogo.tsx@@ -35,6 +35,8 @@ function CustomLogo() {const { openAboutDialog } = useAboutDialogContext();const updateAvailable = useSelector(isUpdateAvailable);const tsType = Pro ? 'PRO' : 'LITE';+ const tsAboutTitle =+ versionMeta.name + ' ' + tsType + ' ' + versionMeta.version;const logo = useMemo(() => {let customLogo = TextLogoIcon;@@ -57,77 +59,89 @@ function CustomLogo() {WebkitAppRegion: 'drag',}}>- <TsIconButton tooltip={t('core:aboutTitle')} style={{ padding: 0 }}>- <img- style={{- width: 30,- height: 30,- padding: 4,- // @ts-ignore- WebkitAppRegion: 'no-drag',- }}- src={LogoIcon}- alt="TagSpaces Logo"- />- </TsIconButton>- <TsIconButton- tooltip={t('core:aboutTitle')}- style={{ height: 40, padding: 4 }}- data-tid="aboutTagSpaces"+ <Tooltip+ title={updateAvailable ? t('core:newVersionAvailable') : tsAboutTitle}+ placeCloser>- <img+ <Badge+ color="secondary"+ variant="dot"+ anchorOrigin={{+ vertical: 'top',+ horizontal: 'right',+ }}+ invisible={!updateAvailable}style={{- maxHeight: 26,- maxWidth: 200,// @ts-ignoreWebkitAppRegion: 'no-drag',+ marginTop: 7,}}- src={logo}- alt="Application Logo"- />- </TsIconButton>- <sup>- <Tooltip title={updateAvailable ? t('core:newVersionAvailable') : ''}>- <Badge- color="secondary"- variant="dot"- anchorOrigin={{- vertical: 'top',- horizontal: 'right',- }}- invisible={!updateAvailable}- style={{- // @ts-ignore- WebkitAppRegion: 'no-drag',- }}+ >+ {AppConfig.showTSLogo && (+ <TsIconButton+ //tooltip={tsAboutTitle}+ style={{ padding: 0, marginTop: -5, height: 40 }}+ >+ <img+ style={{+ width: 30,+ height: 30,+ // @ts-ignore+ WebkitAppRegion: 'no-drag',+ }}+ src={LogoIcon}+ alt="TagSpaces Logo"+ />+ </TsIconButton>+ )}+ <TsIconButton+ // tooltip={tsAboutTitle}+ style={{ height: 40, padding: 0, marginTop: -5 }}+ data-tid="aboutTagSpaces">- <Typography+ <imgstyle={{- display: 'inline',- fontSize: '10px',- marginLeft: 3,- lineHeight: '16px',+ maxHeight: 26,+ maxWidth: 200,+ // @ts-ignore+ WebkitAppRegion: 'no-drag',}}- >- {'v' + versionMeta.version}- </Typography>- </Badge>- </Tooltip>- </sup>- <sub>- <Typography- style={{- display: 'inline',- fontSize: '10px',- marginLeft: -25,- lineHeight: '40px',- // @ts-ignore- WebkitAppRegion: 'no-drag',- }}- >- {tsType}- </Typography>- </sub>+ src={logo}+ alt="Application Logo"+ />+ </TsIconButton>+ {AppConfig.showTSVersion && (+ <>+ <sup>+ <Typography+ style={{+ display: 'inline',+ fontSize: '10px',+ marginLeft: 3,+ lineHeight: '16px',+ }}+ >+ {'v' + versionMeta.version}+ </Typography>+ </sup>+ <sub>+ <Typography+ style={{+ display: 'inline',+ fontSize: '10px',+ marginLeft: -25,+ lineHeight: '40px',+ // @ts-ignore+ WebkitAppRegion: 'no-drag',+ }}+ >+ {tsType}+ </Typography>+ </sub>+ </>+ )}+ </Badge>+ </Tooltip></div>);}diff --git a/src/renderer/components/HelpFeedbackPanel.tsx b/src/renderer/components/HelpFeedbackPanel.tsxindex a9bc61935..b6cd1c6e3 100644--- a/src/renderer/components/HelpFeedbackPanel.tsx+++ b/src/renderer/components/HelpFeedbackPanel.tsx@@ -94,7 +94,7 @@ function HelpFeedbackPanel(props: Props) {<AboutIcon /></ListItemIcon><Typography style={{ color: theme.palette.text.primary }}>- {t('core:aboutTitle')}+ {t('core:aboutTagSpaces')}</Typography></ListItem><ListItemdiff --git a/src/renderer/components/Tooltip.tsx b/src/renderer/components/Tooltip.tsxindex 566acb7dc..01328a558 100644--- a/src/renderer/components/Tooltip.tsx+++ b/src/renderer/components/Tooltip.tsx@@ -24,6 +24,7 @@ interface Props {keyBinding?: string;children: any;classes?: any;+ placeCloser?: boolean;placement?:| 'bottom-end'| 'bottom-start'@@ -40,7 +41,13 @@ interface Props {}function TooltipTS(props: Props) {- const { title, placement = 'top', keyBinding, children } = props;+ const {+ title,+ placement = 'top',+ keyBinding,+ children,+ placeCloser = false,+ } = props;let tooltipText = title;if (keyBinding) {tooltipText = title + ' (' + adjustKeyBinding(keyBinding) + ')';@@ -52,6 +59,18 @@ function TooltipTS(props: Props) {title={tooltipText}disableInteractiveplacement={placement}+ slotProps={{+ popper: {+ modifiers: [+ {+ name: 'offset',+ options: {+ offset: [0, placeCloser ? -12 : -6],+ },+ },+ ],+ },+ }}/>);}diff --git a/src/renderer/locales/ar/core.json b/src/renderer/locales/ar/core.jsonindex 4d5414233..2c8ca2193 100644--- a/src/renderer/locales/ar/core.json+++ b/src/renderer/locales/ar/core.json@@ -10,7 +10,7 @@"unsavedChangesDetails": "By closing the application your changes will be lost.","titleConfirm": "Confirm","titleAlert": "Alert",- "aboutTitle": "About TagSpaces",+ "aboutThisApp": "About","deleteTagGroupContentConfirm": "Do you want to delete the tag group '{{tagGroup}}' ?","deleteLocationContentAlert": "Do you want to delete the location '{{locationName}}'?","deleteLocationTitleAlert": "Delete Location",diff --git a/src/renderer/tagspaces.d.ts b/src/renderer/tagspaces.d.tsindex 486f03023..2ffe17d5b 100644--- a/src/renderer/tagspaces.d.ts+++ b/src/renderer/tagspaces.d.ts@@ -74,6 +74,8 @@ declare interface Window {ExtExtensionsFound?: Array<any>;ExtSearchTypeGroups?: any;ExtDefaultMapBounds?: any;+ ExtShowTSLogo?: boolean;+ ExtShowTSVersion?: boolean;ExtUseOnlyTagsFromTagLibrary?: boolean;}