improve metadata and style ux

This commit is contained in:
vcoppe
2024-07-02 10:21:04 +02:00
parent 8e446ec74a
commit 874eea271e
3 changed files with 14 additions and 2 deletions

View File

@@ -217,6 +217,7 @@
> >
<Info size="16" class="mr-1" /> <Info size="16" class="mr-1" />
{$_('menu.metadata.button')} {$_('menu.metadata.button')}
<Shortcut key="I" ctrl={true} />
</Menubar.Item> </Menubar.Item>
<Menubar.Item <Menubar.Item
disabled={$selection.size === 0 || disabled={$selection.size === 0 ||
@@ -525,6 +526,16 @@
selectAll(); selectAll();
e.preventDefault(); e.preventDefault();
} }
} else if (e.key === 'i' && (e.metaKey || e.ctrlKey)) {
if (
$selection.size === 1 &&
$selection
.getSelected()
.every((item) => item instanceof ListFileItem || item instanceof ListTrackItem)
) {
$editMetadata = true;
}
e.preventDefault();
} else if (e.key === 'p' && (e.metaKey || e.ctrlKey)) { } else if (e.key === 'p' && (e.metaKey || e.ctrlKey)) {
$elevationProfile = !$elevationProfile; $elevationProfile = !$elevationProfile;
e.preventDefault(); e.preventDefault();

View File

@@ -200,6 +200,7 @@
<ContextMenu.Item disabled={!singleSelection} on:click={() => ($editMetadata = true)}> <ContextMenu.Item disabled={!singleSelection} on:click={() => ($editMetadata = true)}>
<Info size="16" class="mr-1" /> <Info size="16" class="mr-1" />
{$_('menu.metadata.button')} {$_('menu.metadata.button')}
<Shortcut key="I" ctrl={true} />
</ContextMenu.Item> </ContextMenu.Item>
<ContextMenu.Item on:click={() => ($editStyle = true)}> <ContextMenu.Item on:click={() => ($editStyle = true)}>
<PaintBucket size="16" class="mr-1" /> <PaintBucket size="16" class="mr-1" />

View File

@@ -58,13 +58,13 @@
"click": "Click", "click": "Click",
"drag": "Drag", "drag": "Drag",
"metadata": { "metadata": {
"button": "Edit info", "button": "Info...",
"name": "Name", "name": "Name",
"description": "Description", "description": "Description",
"save": "Save" "save": "Save"
}, },
"style": { "style": {
"button": "Change style", "button": "Appearance...",
"color": "Color", "color": "Color",
"opacity": "Opacity", "opacity": "Opacity",
"weight": "Weight" "weight": "Weight"