Skip to content

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

chore: optimizations in the grid and list perspectives

Ilian Sapundshiev533b15bf76cf
diff --git a/src/renderer/perspectives/grid/components/GridPagination.tsx b/src/renderer/perspectives/grid/components/GridPagination.tsx
index 288b659fc..84a37d35c 100644
--- a/src/renderer/perspectives/grid/components/GridPagination.tsx
+++ b/src/renderer/perspectives/grid/components/GridPagination.tsx
@@ -381,6 +381,7 @@ function GridPagination(props: Props) {
marginTop: 10,
marginLeft: 8,
marginRight: 8,
+ marginBottom: 5,
borderRadius: AppConfig.defaultCSSRadius,
}}
onDoubleClick={() =>
@@ -415,7 +416,6 @@ function GridPagination(props: Props) {
</Grid>
)}
</Grid>
-
<SelectionDragLayer />
<SelectionArea onSelect={handleSelect}>
<GridCellsContainer>
@@ -509,7 +509,8 @@ function GridPagination(props: Props) {
<div style={{ padding: 15, bottom: 10 }}>
<Typography
style={{
- fontSize: '0.9rem',
+ fontSize: '0.8rem',
+ filter: `drop-shadow(0px 0px 4px ${theme.palette.background.default})`,
color: theme.palette.text.primary,
}}
>
diff --git a/src/renderer/perspectives/grid/hooks/GridCellsStyleProvider.tsx b/src/renderer/perspectives/grid/hooks/GridCellsStyleProvider.tsx
index 85fe311fd..47d93b9ce 100644
--- a/src/renderer/perspectives/grid/hooks/GridCellsStyleProvider.tsx
+++ b/src/renderer/perspectives/grid/hooks/GridCellsStyleProvider.tsx
@@ -16,12 +16,12 @@
*
*/
-import React, { createContext, CSSProperties, useMemo } from 'react';
+import { usePerspectiveSettingsContext } from '-/hooks/usePerspectiveSettingsContext';
import {
calculateEntryHeight,
calculateEntryWidth,
} from '-/perspectives/grid/components/GridCell';
-import { usePerspectiveSettingsContext } from '-/hooks/usePerspectiveSettingsContext';
+import React, { CSSProperties, createContext, useMemo } from 'react';
type GridCellsStyleData = {
cellsStyle: CSSProperties;
@@ -44,10 +44,13 @@ export const GridCellsStyleContextProvider = ({
return {
cellsStyle: {
margin: 0,
+ marginTop: -5,
display: 'grid',
gridGap: '5px 5px',
padding: 5,
+ paddingTop: 10,
paddingBottom: 70,
+ // background: 'red',
gridTemplateColumns:
'repeat(auto-fit,minmax(' +
calculateEntryWidth(entrySize) +
diff --git a/src/renderer/perspectives/list/components/RowCell.tsx b/src/renderer/perspectives/list/components/RowCell.tsx
index e3ed575af..bd4e8f037 100644
--- a/src/renderer/perspectives/list/components/RowCell.tsx
+++ b/src/renderer/perspectives/list/components/RowCell.tsx
@@ -232,8 +232,6 @@ function RowCell(props: Props) {
style={{
width: 40,
height: 35,
- padding: 4,
- paddingBottom: 2,
alignSelf: 'center',
}}
onClick={(e) => {
@@ -245,21 +243,7 @@ function RowCell(props: Props) {
}
}}
>
- {selected ? (
- <SelectedIcon
- style={{
- borderRadius: 15,
- backgroundColor: '#d7d7d7',
- }}
- />
- ) : (
- <UnSelectedIcon
- style={{
- borderRadius: 15,
- backgroundColor: 'd7d7d7',
- }}
- />
- )}
+ {selected ? <SelectedIcon /> : <UnSelectedIcon />}
</TsIconButton>
) : (
<Tooltip title={i18n.t('clickToSelect') + ' ' + fsEntry.path}>
@@ -270,7 +254,7 @@ function RowCell(props: Props) {
paddingLeft: 3,
paddingRight: 3,
fontSize: 13,
- minWidth: 35,
+ minWidth: 40,
color: 'white',
borderRadius: 3,
textAlign: 'center',
@@ -279,7 +263,6 @@ function RowCell(props: Props) {
textShadow: '1px 1px #8f8f8f',
textOverflow: 'unset',
height: 15,
- maxWidth: fsEntry.isFile ? 50 : 100,
alignSelf: 'center',
}}
noWrap={true}
@@ -308,6 +291,7 @@ function RowCell(props: Props) {
data-entry-id={fsEntry.uuid}
style={{
boxShadow: 'none',
+ borderRadius: AppConfig.defaultCSSRadius,
borderLeft:
'1px solid ' +
(selected
@@ -347,9 +331,11 @@ function RowCell(props: Props) {
<Grid
container
wrap="nowrap"
+ style={{
+ borderRadius: AppConfig.defaultCSSRadius,
+ }}
sx={{
backgroundColor,
- borderRadius: '4px',
'&:hover': {
backgroundColor: theme.palette.divider + ' !important',
},
@@ -358,7 +344,7 @@ function RowCell(props: Props) {
<Grid
style={{
minHeight: entryHeight,
- width: 45,
+ width: 50,
height: 30,
padding: 3,
paddingLeft: 5,