1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 02:12:30 +01:00

add clear working dir button

in settings too
This commit is contained in:
Mikael Finstad 2024-03-23 11:34:33 +08:00
parent df03b33e36
commit 305b23fb20
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -1,6 +1,6 @@
import { CSSProperties, ChangeEventHandler, memo, useCallback, useMemo, useState } from 'react';
import { FaYinYang, FaKeyboard } from 'react-icons/fa';
import { GlobeIcon, CleanIcon, CogIcon, Button, NumericalIcon, FolderCloseIcon, DocumentIcon, TimeIcon } from 'evergreen-ui';
import { GlobeIcon, CleanIcon, CogIcon, Button, NumericalIcon, FolderCloseIcon, DocumentIcon, TimeIcon, CrossIcon } from 'evergreen-ui';
import { useTranslation } from 'react-i18next';
import { HTMLMotionProps, motion } from 'framer-motion';
import invariant from 'tiny-invariant';
@ -47,12 +47,14 @@ const Settings = memo(({
askForCleanupChoices,
toggleStoreProjectInWorkingDir,
simpleMode,
clearOutDir,
}: {
onTunerRequested: (type: TunerType) => void,
onKeyboardShortcutsDialogRequested: () => void,
askForCleanupChoices: () => Promise<void>,
toggleStoreProjectInWorkingDir: () => Promise<void>,
simpleMode: boolean,
clearOutDir: () => Promise<void>,
}) => {
const { t } = useTranslation();
const [showAdvanced, setShowAdvanced] = useState(!simpleMode);
@ -205,6 +207,15 @@ const Settings = memo(({
{customOutDir ? t('Custom working directory') : t('Same directory as input file')}...
</Button>
<div>{customOutDir}</div>
{customOutDir && (
<Button
height={20}
iconBefore={CrossIcon}
onClick={clearOutDir}
>
{t('Clear working directory')}
</Button>
)}
</td>
</Row>