tab context menu and shortcuts

This commit is contained in:
vcoppe
2024-04-29 17:03:23 +02:00
parent a6bcebf306
commit 49053bcaaa
20 changed files with 409 additions and 24 deletions

View File

@@ -0,0 +1,21 @@
<script lang="ts">
import { onMount } from 'svelte';
import { _ } from 'svelte-i18n';
export let key: string;
export let shift: boolean = false;
export let ctrl: boolean = false;
export let click: boolean = false;
let isMac = false;
onMount(() => {
isMac = navigator.userAgent.toUpperCase().indexOf('MAC') >= 0;
});
</script>
<span class="ml-auto pl-2 text-xs tracking-widest text-muted-foreground"
>{shift ? '⇧' : ''}{ctrl ? (isMac ? '⌘' : $_('menu.ctrl') + '+') : ''}{key}{click
? $_('menu.click')
: ''}</span
>