diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index a33501b4..34b77a0b 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -612,6 +612,8 @@ "autoFitColumns": "auto fit columns", "displayType": "display type", "gap": "$t(common.gap)", + "itemGap": "item gap (px)", + "itemSize": "item size (px)", "size": "$t(common.size)", "tableColumns": "table columns" }, diff --git a/src/renderer/components/virtual-grid/virtual-infinite-grid.tsx b/src/renderer/components/virtual-grid/virtual-infinite-grid.tsx index ecb05bde..e313d942 100644 --- a/src/renderer/components/virtual-grid/virtual-infinite-grid.tsx +++ b/src/renderer/components/virtual-grid/virtual-infinite-grid.tsx @@ -72,7 +72,7 @@ export const VirtualInfiniteGrid = forwardRef( const [itemData, setItemData] = useState(fetchInitialData?.() || []); const { itemHeight, rowCount, columnCount } = useMemo(() => { - const itemsPerRow = width ? Math.floor(width / itemSize) : 5; + const itemsPerRow = width ? Math.floor(width / (itemSize + itemGap * 2)) : 5; const widthPerItem = Number(width) / itemsPerRow; const itemHeight = widthPerItem + cardRows.length * 26; @@ -81,7 +81,7 @@ export const VirtualInfiniteGrid = forwardRef( itemHeight, rowCount: Math.ceil(itemCount / itemsPerRow), }; - }, [cardRows.length, itemCount, itemSize, width]); + }, [cardRows.length, itemCount, itemGap, itemSize, width]); const isItemLoaded = useCallback( (index: number) => { diff --git a/src/renderer/features/albums/components/album-list-header-filters.tsx b/src/renderer/features/albums/components/album-list-header-filters.tsx index ffe54b42..c1710f65 100644 --- a/src/renderer/features/albums/components/album-list-header-filters.tsx +++ b/src/renderer/features/albums/components/album-list-header-filters.tsx @@ -538,7 +538,9 @@ export const AlbumListHeaderFilters = ({ gridRef, tableRef }: AlbumListHeaderFil Table (paginated) */} - Item size + + {t('table.config.general.itemSize', { postProcess: 'sentenceCase' })} + {isGrid && ( <> - Item gap + + {t('table.config.general.itemGap', { + postProcess: 'sentenceCase', + })} + */} - Item size + + {t('table.config.general.itemSize', { postProcess: 'sentenceCase' })} + {display === ListDisplayType.CARD || display === ListDisplayType.POSTER ? ( @@ -493,7 +495,11 @@ export const AlbumArtistListHeaderFilters = ({ {isGrid && ( <> - Item gap + + {t('table.config.general.itemGap', { + postProcess: 'sentenceCase', + })} + */} - Item size + + {t('table.config.general.itemSize', { postProcess: 'sentenceCase' })} + */} - Item size + + {t('table.config.general.itemSize', { postProcess: 'sentenceCase' })} + - {isGrid && ( - <> - Item gap - - - - - )} + {isGrid && ( + <> + + {t('table.config.general.itemGap', { + postProcess: 'sentenceCase', + })} + + + + + + )} {!isGrid && ( <>