mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 21:46:35 +00:00
refactor: change show mask flow - checkbox in params
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import CheckboxField from '../ui/CheckboxField.svelte';
|
||||
import Button from '../ui/Button.svelte';
|
||||
import DownloadButton from '../DownloadButton.svelte';
|
||||
import EmptyState from '../ui/EmptyState.svelte';
|
||||
@@ -17,8 +16,7 @@
|
||||
sourceLoaded: boolean;
|
||||
status: Status;
|
||||
result: PixelImage | null;
|
||||
previewResult: PixelImage | null;
|
||||
showMask: boolean;
|
||||
displayImage: PixelImage | null;
|
||||
info: ImageInfo | null;
|
||||
isInfo: boolean;
|
||||
params: Record<string, unknown>;
|
||||
@@ -33,8 +31,7 @@
|
||||
sourceLoaded,
|
||||
status,
|
||||
result,
|
||||
previewResult,
|
||||
showMask = $bindable(false),
|
||||
displayImage,
|
||||
info,
|
||||
isInfo,
|
||||
params,
|
||||
@@ -43,9 +40,6 @@
|
||||
hasChain = false,
|
||||
onDownloadError
|
||||
}: Props = $props();
|
||||
|
||||
const hasPreview = $derived(typeof tool.preview === 'function');
|
||||
const shown = $derived(showMask && previewResult ? previewResult : result);
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
@@ -77,11 +71,8 @@
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
{#if hasPreview}
|
||||
<CheckboxField id="show-mask" label="Показать маску" bind:checked={showMask} />
|
||||
{/if}
|
||||
<div class="media">
|
||||
<Preview image={shown} />
|
||||
<Preview image={displayImage} />
|
||||
{#if status === 'processing'}
|
||||
<span class="recalc" aria-live="polite">Пересчёт…</span>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user