Skip to content

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

core: added divider to the entry menu and other small css improvements

Ilian Sapundshiev43e20e19440b
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index 64a519006..749e6202f 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -921,59 +921,71 @@ function EntryContainer(props: Props) {
paddingRight: editingSupported ? 85 : 5
}}
>
- <Button
- id="actions-button"
- data-tid="propsActionsMenuTID"
- aria-controls={Boolean(anchorEl) ? 'basic-menu' : undefined}
- aria-haspopup="true"
- aria-expanded={Boolean(anchorEl) ? 'true' : undefined}
- endIcon={<MoreVertIcon sx={{ fontSize: 20 }} />}
- onClick={(event: React.MouseEvent<HTMLElement>) => {
- setAnchorEl(event.currentTarget);
- }}
- >
- {openedFile.isFile ? (
- <>
- {fileChanged.current ? (
- <Tooltip title={i18n.t('core:fileChanged')}>
- <span
- style={{
- color: theme.palette.text.primary,
- margin: 3
- }}
- >
- {String.fromCharCode(0x25cf)}
- </span>
- </Tooltip>
- ) : (
- ''
- )}
- <span
- className={classes.fileBadge}
- style={{
- backgroundColor: openedFile.color,
- textTransform: 'uppercase'
- }}
- >
- {'.' +
- extractFileExtension(
- openedFile.path,
- PlatformIO.getDirSeparator()
- )}
- </span>
- </>
- ) : (
+ {openedFile.isFile ? (
+ <>
+ {fileChanged.current ? (
+ <Tooltip title={i18n.t('core:fileChanged')}>
+ <span
+ style={{
+ color: theme.palette.text.primary,
+ margin: 3
+ }}
+ >
+ {String.fromCharCode(0x25cf)}
+ </span>
+ </Tooltip>
+ ) : (
+ ''
+ )}
<span
className={classes.fileBadge}
title={i18n.t('core:toggleEntryProperties')}
+ data-tid="propsActionsMenuTID"
+ aria-controls={Boolean(anchorEl) ? 'basic-menu' : undefined}
+ aria-haspopup="true"
+ aria-expanded={Boolean(anchorEl) ? 'true' : undefined}
+ // endIcon={<MoreVertIcon sx={{ fontSize: 20 }} />}
+ onClick={(event: React.MouseEvent<HTMLElement>) => {
+ setAnchorEl(event.currentTarget);
+ }}
style={{
- backgroundColor: AppConfig.defaultFolderColor
+ backgroundColor: openedFile.color,
+ display: 'flex',
+ alignItems: 'center',
+ textTransform: 'uppercase',
+ paddingLeft: 10
}}
>
- {i18n.t('core:folder')}
+ {//'.' +
+ extractFileExtension(
+ openedFile.path,
+ PlatformIO.getDirSeparator()
+ )}
+ <MoreVertIcon style={{ fontSize: 20 }} />
</span>
- )}
- </Button>
+ </>
+ ) : (
+ <span
+ className={classes.fileBadge}
+ title={i18n.t('core:toggleEntryProperties')}
+ data-tid="propsActionsMenuTID"
+ aria-controls={Boolean(anchorEl) ? 'basic-menu' : undefined}
+ aria-haspopup="true"
+ aria-expanded={Boolean(anchorEl) ? 'true' : undefined}
+ // endIcon={<MoreVertIcon sx={{ fontSize: 20 }} />}
+ onClick={(event: React.MouseEvent<HTMLElement>) => {
+ setAnchorEl(event.currentTarget);
+ }}
+ style={{
+ backgroundColor: AppConfig.defaultFolderColor,
+ display: 'flex',
+ alignItems: 'center'
+ }}
+ >
+ {i18n.t('core:folder')}
+ <MoreVertIcon style={{ fontSize: 20 }} />
+ </span>
+ )}
<EntryContainerMenu
anchorEl={anchorEl}
handleClose={() => setAnchorEl(null)}
@@ -983,13 +995,14 @@ function EntryContainer(props: Props) {
sharingParentFolderLink={sharingParentFolderLink}
toggleFullScreen={toggleFullScreen}
/>
- <Tooltip title={fileName}>
+ <Tooltip title={openedFile.isFile && fileName}>
<Box
data-tid={'OpenedTID' + dataTidFormat(fileName)}
style={{
color: theme.palette.text.primary,
display: 'inline',
fontSize: 17,
+ marginLeft: 5,
maxHeight: 40,
overflowY: 'auto'
}}
diff --git a/app/components/EntryContainerMenu.tsx b/app/components/EntryContainerMenu.tsx
index 9a18e8330..f50902605 100644
--- a/app/components/EntryContainerMenu.tsx
+++ b/app/components/EntryContainerMenu.tsx
@@ -10,6 +10,7 @@ import {
ListItemText,
Menu,
MenuItem,
+ Divider,
Typography
} from '@mui/material';
import {
@@ -193,6 +194,7 @@ function EntryContainerMenu(props: Props) {
<ListItemText primary={i18n.t('core:downloadFile')} />
</MenuItem>
);
+ menuItems.push(<Divider />);
menuItems.push(
<MenuItem
data-tid="fileContainerSwitchToFullScreen"
@@ -225,6 +227,7 @@ function EntryContainerMenu(props: Props) {
</MenuItem>
);
}
+ menuItems.push(<Divider />);
menuItems.push(
<MenuItem
data-tid="navigateToParentTID"
@@ -301,6 +304,7 @@ function EntryContainerMenu(props: Props) {
</MenuItem>
);
if (!readOnlyMode) {
+ menuItems.push(<Divider />);
menuItems.push(
<MenuItem
data-tid="deleteEntryTID"
@@ -365,21 +369,6 @@ function EntryContainerMenu(props: Props) {
</MenuItem>
);
}
- menuItems.push(
- <MenuItem
- data-tid="reloadFolderTID"
- aria-label={i18n.t('core:reloadDirectory')}
- onClick={() => {
- reloadDocument();
- handleClose();
- }}
- >
- <ListItemIcon>
- <ReloadIcon />
- </ListItemIcon>
- <ListItemText primary={i18n.t('core:reloadDirectory')} />
- </MenuItem>
- );
if (desktopMode) {
menuItems.push(
<MenuItem
@@ -397,6 +386,22 @@ function EntryContainerMenu(props: Props) {
</MenuItem>
);
}
+ menuItems.push(<Divider />);
+ menuItems.push(
+ <MenuItem
+ data-tid="reloadFolderTID"
+ aria-label={i18n.t('core:reloadDirectory')}
+ onClick={() => {
+ reloadDocument();
+ handleClose();
+ }}
+ >
+ <ListItemIcon>
+ <ReloadIcon />
+ </ListItemIcon>
+ <ListItemText primary={i18n.t('core:reloadDirectory')} />
+ </MenuItem>
+ );
if (!readOnlyMode) {
menuItems.push(
<MenuItem
diff --git a/app/components/PathBreadcrumbs.tsx b/app/components/PathBreadcrumbs.tsx
index ad88c252a..63f71bf40 100644
--- a/app/components/PathBreadcrumbs.tsx
+++ b/app/components/PathBreadcrumbs.tsx
@@ -207,6 +207,7 @@ function PathBreadcrumbs(props: Props) {
onDelete={openDirectoryMenu}
onClick={openDirectoryMenu}
onContextMenu={openDirectoryMenu}
+ style={{ marginRight: 2 }}
/>
</Tooltip>
);