grid commands + ctx menu

This commit is contained in:
Jan Prochazka
2021-03-06 20:32:02 +01:00
parent 49f22e1a3b
commit e49c0169da
5 changed files with 168 additions and 19 deletions

View File

@@ -1,3 +1,11 @@
<script context="module">
function getCommandTitle(command) {
let res = command.text;
if (command.keyText) res += ` (${command.keyText})`;
return res;
}
</script>
<script>
import _ from 'lodash';
import App from '../App.svelte';
@@ -12,9 +20,14 @@
<div class="container">
{#each list as command}
<ToolbarButton icon={command.icon} on:click={command.onClick} disabled={!command.enabled}
>{command.toolbarName || command.name}</ToolbarButton
<ToolbarButton
icon={command.icon}
on:click={command.onClick}
disabled={!command.enabled}
title={getCommandTitle(command)}
>
{command.toolbarName || command.name}
</ToolbarButton>
{/each}
</div>