Change scanlator exclusion filter checked icon to "X"

This commit is contained in:
schroda
2025-07-20 22:56:08 +02:00
parent 53b14a8878
commit bbb2da52f4
2 changed files with 12 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
import { bindTrigger, usePopupState } from 'material-ui-popup-state/hooks';
import { useTranslation } from 'react-i18next';
import PeopleAltOutlinedIcon from '@mui/icons-material/PeopleAltOutlined';
import DisabledByDefaultRounded from '@mui/icons-material/DisabledByDefaultRounded';
import { CheckboxListSetting } from '@/modules/core/components/settings/CheckboxListSetting.tsx';
import { updateChapterListOptions } from '@/modules/chapter/utils/ChapterList.util.tsx';
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
@@ -51,6 +52,11 @@ export const ChapterExcludeSanlatorsFilter = ({
getId={(scanlator) => scanlator}
getLabel={(scanlator) => scanlator}
isChecked={(scanlator) => excludedScanlators.includes(scanlator)}
slotProps={{
checkbox: {
checkedIcon: <DisabledByDefaultRounded />,
},
}}
/>
</>
);

View File

@@ -15,6 +15,7 @@ import FormGroup from '@mui/material/FormGroup';
import { useTranslation } from 'react-i18next';
import Stack from '@mui/material/Stack';
import { useCallback, useMemo } from 'react';
import { CheckboxProps } from '@mui/material/Checkbox';
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
import { useSelectableCollection } from '@/modules/collection/hooks/useSelectableCollection.ts';
@@ -27,6 +28,7 @@ export function CheckboxListSetting<Item>({
isChecked,
open,
onClose,
slotProps,
}: {
title: string;
emptyMessage?: string;
@@ -36,6 +38,9 @@ export function CheckboxListSetting<Item>({
isChecked: (item: Item) => boolean;
open: boolean;
onClose: (selectedItems?: Item[]) => void;
slotProps?: {
checkbox?: Omit<CheckboxProps, 'checked' | 'onChange' | 'label'>;
};
}) {
const { t } = useTranslation();
@@ -80,6 +85,7 @@ export function CheckboxListSetting<Item>({
{items.length === 0 && <span>{emptyMessage}</span>}
{items.map((item) => (
<CheckboxInput
{...slotProps?.checkbox}
checked={selectedItemIds.includes(getId(item))}
onChange={(e, checked) => handleSelection(getId(item), checked)}
label={getLabel(item)}