mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 15:43:25 +00:00
add first tool
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { reverseSelectedFiles } from '$lib/stores';
|
||||||
import ToolbarItem from './ToolbarItem.svelte';
|
import ToolbarItem from './ToolbarItem.svelte';
|
||||||
import {
|
import {
|
||||||
ArrowRightLeft,
|
ArrowRightLeft,
|
||||||
@@ -24,9 +25,9 @@
|
|||||||
<CalendarClock slot="icon" size="18" />
|
<CalendarClock slot="icon" size="18" />
|
||||||
<span slot="tooltip">Change time and speed data</span>
|
<span slot="tooltip">Change time and speed data</span>
|
||||||
</ToolbarItem>
|
</ToolbarItem>
|
||||||
<ToolbarItem>
|
<ToolbarItem on:click={reverseSelectedFiles}>
|
||||||
<ArrowRightLeft slot="icon" size="18" />
|
<ArrowRightLeft slot="icon" size="18" />
|
||||||
<span slot="tooltip">Reverse the order of the track points</span>
|
<span slot="tooltip">Reverse the file</span>
|
||||||
</ToolbarItem>
|
</ToolbarItem>
|
||||||
<ToolbarItem>
|
<ToolbarItem>
|
||||||
<Group slot="icon" size="18" />
|
<Group slot="icon" size="18" />
|
||||||
@@ -46,7 +47,9 @@
|
|||||||
</ToolbarItem>
|
</ToolbarItem>
|
||||||
<ToolbarItem>
|
<ToolbarItem>
|
||||||
<SquareDashedMousePointer slot="icon" size="18" />
|
<SquareDashedMousePointer slot="icon" size="18" />
|
||||||
<span slot="tooltip">Clean track points and POIs with a rectangle selection</span>
|
<span slot="tooltip"
|
||||||
|
>Clean track points and points of interest with a rectangle selection</span
|
||||||
|
>
|
||||||
</ToolbarItem>
|
</ToolbarItem>
|
||||||
<ToolbarItem>
|
<ToolbarItem>
|
||||||
<Palette slot="icon" size="18" />
|
<Palette slot="icon" size="18" />
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
class="h-fit px-1 py-1.5"
|
class="h-fit px-1 py-1.5"
|
||||||
disabled={$selectedFiles.size == 0}
|
disabled={$selectedFiles.size == 0}
|
||||||
|
on:click
|
||||||
>
|
>
|
||||||
<slot name="icon" />
|
<slot name="icon" />
|
||||||
</Button>
|
</Button>
|
||||||
|
@@ -105,6 +105,10 @@ export function exportFile(file: GPXFile) {
|
|||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function reverseSelectedFiles() {
|
||||||
|
get(selectedFiles).forEach(file => file.reverse());
|
||||||
|
}
|
||||||
|
|
||||||
export function selectFile(file: GPXFile) {
|
export function selectFile(file: GPXFile) {
|
||||||
selectedFiles.update($selectedFiles => {
|
selectedFiles.update($selectedFiles => {
|
||||||
$selectedFiles.clear();
|
$selectedFiles.clear();
|
||||||
|
Reference in New Issue
Block a user