Skip to content

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

optimizing compact mode in grid perspective

Ilian Sapundshiev99987a7929ce
diff --git a/app/perspectives/grid-perspective/components/CellContent.tsx b/app/perspectives/grid-perspective/components/CellContent.tsx
index 9b74bb0d1..0dfac643b 100644
--- a/app/perspectives/grid-perspective/components/CellContent.tsx
+++ b/app/perspectives/grid-perspective/components/CellContent.tsx
@@ -25,7 +25,7 @@ import Typography from '@material-ui/core/Typography';
import IconButton from '@material-ui/core/IconButton';
import Paper from '@material-ui/core/Paper';
import FolderIcon from '@material-ui/icons/FolderOpen';
-import TagIcon from '@material-ui/icons/LocalOffer';
+import TagIcon from '@material-ui/icons/LocalOfferOutlined';
import { formatFileSize, formatDateTime } from '-/utils/misc';
import { extractTitle } from '-/utils/paths';
import { FileSystemEntry, findColorForFileEntry } from '-/services/utils-io';
@@ -230,6 +230,8 @@ const CellContent = (props: Props) => {
item
style={{
minHeight: entryHeight,
+ width: 70,
+ maxWidth: 70,
padding: 10,
marginRight: 5,
backgroundColor: fsEntryBackgroundColor
@@ -252,12 +254,31 @@ const CellContent = (props: Props) => {
</span>
)}
</Grid>
- <Grid item xs zeroMinWidth>
- <Typography style={{ wordBreak: 'break-all' }}>
- {extractTitle(fsEntry.name, !fsEntry.isFile)}
- </Typography>
- {showTags ? fsEntry.tags.map(tag => renderTag(tag)) : tagPlaceholder}
- {entrySize !== 'small' && (
+ {entrySize === 'small' ? (
+ <Grid
+ item
+ xs
+ zeroMinWidth
+ style={{
+ display: 'flex'
+ }}
+ >
+ <Typography style={{ wordBreak: 'break-all', alignSelf: 'center' }}>
+ {extractTitle(fsEntry.name, !fsEntry.isFile)}
+ &nbsp;
+ {showTags
+ ? fsEntry.tags.map(tag => renderTag(tag))
+ : tagPlaceholder}
+ </Typography>
+ </Grid>
+ ) : (
+ <Grid item xs zeroMinWidth>
+ <Typography style={{ wordBreak: 'break-all' }}>
+ {extractTitle(fsEntry.name, !fsEntry.isFile)}
+ </Typography>
+ {showTags
+ ? fsEntry.tags.map(tag => renderTag(tag))
+ : tagPlaceholder}
<Typography
style={{
color: 'gray',
@@ -286,8 +307,8 @@ const CellContent = (props: Props) => {
{description && description}
</span>
</Typography>
- )}
- </Grid>
+ </Grid>
+ )}
{fsEntry.thumbPath && (
<Grid item>
<img
diff --git a/app/perspectives/grid-perspective/components/styles.css.tsx b/app/perspectives/grid-perspective/components/styles.css.tsx
index 9414d2801..be909d63b 100644
--- a/app/perspectives/grid-perspective/components/styles.css.tsx
+++ b/app/perspectives/grid-perspective/components/styles.css.tsx
@@ -128,8 +128,6 @@ export default (theme: any): any => ({
rowFolder: {
color: 'white',
padding: 5,
- marginRight: 5,
- marginTop: 5,
minHeight: 10,
height: 20
},