grey out items being cut

This commit is contained in:
vcoppe
2024-07-18 00:37:13 +02:00
parent 3f6f9a8844
commit e16c92fe0a
2 changed files with 4 additions and 1 deletions

View File

@@ -30,6 +30,7 @@
import { import {
copied, copied,
copySelection, copySelection,
cut,
cutSelection, cutSelection,
pasteSelection, pasteSelection,
selectAll, selectAll,
@@ -144,6 +145,8 @@
{/if} {/if}
<span <span
class="w-full text-left truncate py-1 flex flex-row items-center {hidden class="w-full text-left truncate py-1 flex flex-row items-center {hidden
? 'text-muted-foreground'
: ''} {$cut && $copied?.some((i) => i.getFullId() === item.getFullId())
? 'text-muted-foreground' ? 'text-muted-foreground'
: ''}" : ''}"
on:contextmenu={(e) => { on:contextmenu={(e) => {

View File

@@ -230,7 +230,7 @@ export function applyToOrderedSelectedItemsFromFile(callback: (fileId: string, l
} }
export const copied = writable<ListItem[] | undefined>(undefined); export const copied = writable<ListItem[] | undefined>(undefined);
const cut = writable(false); export const cut = writable(false);
export function copySelection(): boolean { export function copySelection(): boolean {
let selected = get(selection).getSelected(); let selected = get(selection).getSelected();