mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-19 18:04:22 +02:00
remove horizontal padding from favorite/rating/actions
This commit is contained in:
@@ -246,6 +246,11 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.row .track-cell-no-h-padding {
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.track-row-dragging {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import { parseTableColumns } from '/@/renderer/components/item-list/helpers/pars
|
||||
import { getDetailListCellComponent } from '/@/renderer/components/item-list/item-detail-list/columns';
|
||||
import {
|
||||
getTrackColumnFixed,
|
||||
isNoHorizontalPaddingColumn,
|
||||
shouldShowHoverOnlyColumnContent,
|
||||
} from '/@/renderer/components/item-list/item-detail-list/utils';
|
||||
import {
|
||||
@@ -250,6 +251,7 @@ const TrackRow = memo(
|
||||
const CellComponent = getDetailListCellComponent(col.id);
|
||||
const isTitleColumn = col.id === TableColumn.TITLE;
|
||||
const isImageColumn = col.id === TableColumn.IMAGE;
|
||||
const isIconActionColumn = isNoHorizontalPaddingColumn(col.id);
|
||||
const showHoverContent = shouldShowHoverOnlyColumnContent(
|
||||
col.id,
|
||||
isRowHovered,
|
||||
@@ -278,6 +280,7 @@ const TrackRow = memo(
|
||||
className={clsx(styles.trackCell, {
|
||||
[styles.trackCellImage]: isImageColumn,
|
||||
[styles.trackCellMuted]: !isTitleColumn,
|
||||
[styles.trackCellNoHPadding]: isIconActionColumn,
|
||||
[styles.trackCellVerticalBorderVisible]:
|
||||
enableVerticalBorders && !isLastColumn,
|
||||
[styles.trackCellWithVerticalBorder]: !isLastColumn,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { TableColumn } from '/@/shared/types/types';
|
||||
|
||||
const FIXED_TRACK_COLUMN_WIDTHS: Partial<Record<TableColumn, number>> = {
|
||||
[TableColumn.ACTIONS]: 48,
|
||||
[TableColumn.ACTIONS]: 32,
|
||||
[TableColumn.TRACK_NUMBER]: 56,
|
||||
[TableColumn.USER_FAVORITE]: 48,
|
||||
[TableColumn.USER_RATING]: 76,
|
||||
[TableColumn.USER_FAVORITE]: 32,
|
||||
[TableColumn.USER_RATING]: 64,
|
||||
};
|
||||
|
||||
const HOVER_ONLY_COLUMNS: TableColumn[] = [
|
||||
@@ -13,6 +13,12 @@ const HOVER_ONLY_COLUMNS: TableColumn[] = [
|
||||
TableColumn.USER_RATING,
|
||||
];
|
||||
|
||||
const NO_HORIZONTAL_PADDING_COLUMNS: TableColumn[] = [
|
||||
TableColumn.ACTIONS,
|
||||
TableColumn.USER_FAVORITE,
|
||||
TableColumn.USER_RATING,
|
||||
];
|
||||
|
||||
export function getTrackColumnFixed(columnId: TableColumn): {
|
||||
fixedWidth: number;
|
||||
isFixedColumn: boolean;
|
||||
@@ -23,6 +29,10 @@ export function getTrackColumnFixed(columnId: TableColumn): {
|
||||
: { fixedWidth: 0, isFixedColumn: false };
|
||||
}
|
||||
|
||||
export function isNoHorizontalPaddingColumn(columnId: TableColumn): boolean {
|
||||
return NO_HORIZONTAL_PADDING_COLUMNS.includes(columnId);
|
||||
}
|
||||
|
||||
export function isTrackColumnHoverOnly(columnId: TableColumn): boolean {
|
||||
return HOVER_ONLY_COLUMNS.includes(columnId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user