mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-19 09:22:12 +00:00
reorder context menu items
This commit is contained in:
1 parent
5bc35f30d9
commit
c842da8dc1
1 file changed
+20
-19
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import * as ContextMenu from '$lib/components/ui/context-menu';
|
import * as ContextMenu from '$lib/components/ui/context-menu';
|
||||||
import {
|
import {
|
||||||
ExternalLink,
|
ArrowUpRight,
|
||||||
FileX,
|
FileX,
|
||||||
FolderOpen,
|
FolderOpen,
|
||||||
FolderX,
|
FolderX,
|
||||||
PencilLine,
|
PenLine,
|
||||||
Plus,
|
Plus,
|
||||||
Trash2,
|
Trash2,
|
||||||
} from '@lucide/svelte';
|
} from '@lucide/svelte';
|
||||||
@@ -296,38 +296,39 @@
|
|||||||
<FolderOpen size="16" />
|
<FolderOpen size="16" />
|
||||||
{i18n._('menu.explorer_menu.open')}
|
{i18n._('menu.explorer_menu.open')}
|
||||||
</ContextMenu.Item>
|
</ContextMenu.Item>
|
||||||
{#if openIds().length > 0}
|
|
||||||
<ContextMenu.Item onclick={() => closeFiles(openIds())}>
|
|
||||||
<FileX size="16" />
|
|
||||||
{i18n._('menu.close')}
|
|
||||||
</ContextMenu.Item>
|
|
||||||
{/if}
|
|
||||||
<ContextMenu.Separator />
|
|
||||||
{/if}
|
{/if}
|
||||||
|
<ContextMenu.Item onclick={() => engine.revealPath(path)}>
|
||||||
|
<ArrowUpRight size="16" />
|
||||||
|
{i18n._(isMac() ? 'menu.explorer_menu.reveal_finder' : 'menu.explorer_menu.reveal')}
|
||||||
|
</ContextMenu.Item>
|
||||||
|
<ContextMenu.Separator />
|
||||||
{#if kind !== 'root'}
|
{#if kind !== 'root'}
|
||||||
<ContextMenu.Item
|
<ContextMenu.Item
|
||||||
disabled={targets().length !== 1}
|
disabled={targets().length !== 1}
|
||||||
onclick={() => (renaming.path = path)}
|
onclick={() => (renaming.path = path)}
|
||||||
>
|
>
|
||||||
<PencilLine size="16" />
|
<PenLine size="16" />
|
||||||
{i18n._('menu.explorer_menu.rename')}
|
{i18n._('menu.explorer_menu.rename')}
|
||||||
</ContextMenu.Item>
|
</ContextMenu.Item>
|
||||||
<ContextMenu.Item onclick={remove}>
|
|
||||||
<Trash2 size="16" />
|
|
||||||
{i18n._('menu.delete')}
|
|
||||||
</ContextMenu.Item>
|
|
||||||
<ContextMenu.Separator />
|
<ContextMenu.Separator />
|
||||||
{/if}
|
{/if}
|
||||||
<ContextMenu.Item onclick={() => engine.revealPath(path)}>
|
|
||||||
<ExternalLink size="16" />
|
|
||||||
{i18n._(isMac() ? 'menu.explorer_menu.reveal_finder' : 'menu.explorer_menu.reveal')}
|
|
||||||
</ContextMenu.Item>
|
|
||||||
{#if kind === 'root'}
|
{#if kind === 'root'}
|
||||||
<ContextMenu.Separator />
|
|
||||||
<ContextMenu.Item onclick={closeFolder}>
|
<ContextMenu.Item onclick={closeFolder}>
|
||||||
<FolderX size="16" />
|
<FolderX size="16" />
|
||||||
{i18n._('menu.close_folder')}
|
{i18n._('menu.close_folder')}
|
||||||
</ContextMenu.Item>
|
</ContextMenu.Item>
|
||||||
|
{:else}
|
||||||
|
{#if kind === 'file' && openIds().length > 0}
|
||||||
|
<ContextMenu.Item onclick={() => closeFiles(openIds())}>
|
||||||
|
<FileX size="16" />
|
||||||
|
{i18n._('menu.close')}
|
||||||
|
</ContextMenu.Item>
|
||||||
|
<ContextMenu.Separator />
|
||||||
|
{/if}
|
||||||
|
<ContextMenu.Item onclick={remove}>
|
||||||
|
<Trash2 size="16" />
|
||||||
|
{i18n._('menu.delete')}
|
||||||
|
</ContextMenu.Item>
|
||||||
{/if}
|
{/if}
|
||||||
</ContextMenu.Content>
|
</ContextMenu.Content>
|
||||||
</ContextMenu.Root>
|
</ContextMenu.Root>
|
||||||
Reference in new issue
Block a user