mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-04 01:22:32 +00:00
small ui improvements
This commit is contained in:
@@ -64,11 +64,11 @@
|
|||||||
<span class="mx-1">/</span>
|
<span class="mx-1">/</span>
|
||||||
<WithUnits value={statistics.global.speed.total} type="speed" />
|
<WithUnits value={statistics.global.speed.total} type="speed" />
|
||||||
</span>
|
</span>
|
||||||
<span slot="tooltip"
|
<span slot="tooltip">
|
||||||
>{$velocityUnits === 'speed' ? $_('quantities.speed') : $_('quantities.pace')} ({$_(
|
{$velocityUnits === 'speed' ? $_('quantities.speed') : $_('quantities.pace')} ({$_(
|
||||||
'quantities.moving'
|
'quantities.moving'
|
||||||
)} / {$_('quantities.total')})</span
|
)} / {$_('quantities.total')})
|
||||||
>
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
{/if}
|
{/if}
|
||||||
{#if panelSize > 160 || orientation === 'horizontal'}
|
{#if panelSize > 160 || orientation === 'horizontal'}
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
<div class="flex flex-col gap-3 w-full max-w-80 {$$props.class ?? ''}">
|
<div class="flex flex-col gap-3 w-full max-w-80 {$$props.class ?? ''}">
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
class="whitespace-normal h-fit"
|
||||||
disabled={!validSelection}
|
disabled={!validSelection}
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
if ($map) {
|
if ($map) {
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MountainSnow size="16" class="mr-1" />
|
<MountainSnow size="16" class="mr-1 shrink-0" />
|
||||||
{$_('toolbar.elevation.button')}
|
{$_('toolbar.elevation.button')}
|
||||||
</Button>
|
</Button>
|
||||||
<Help link="./help/toolbar/elevation">
|
<Help link="./help/toolbar/elevation">
|
||||||
|
@@ -65,13 +65,14 @@
|
|||||||
</RadioGroup.Root>
|
</RadioGroup.Root>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
class="whitespace-normal h-fit"
|
||||||
disabled={(mergeType === MergeType.TRACES && !canMergeTraces) ||
|
disabled={(mergeType === MergeType.TRACES && !canMergeTraces) ||
|
||||||
(mergeType === MergeType.CONTENTS && !canMergeContents)}
|
(mergeType === MergeType.CONTENTS && !canMergeContents)}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
dbUtils.mergeSelection(mergeType === MergeType.TRACES);
|
dbUtils.mergeSelection(mergeType === MergeType.TRACES);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Group size="16" class="mr-1" />
|
<Group size="16" class="mr-1 shrink-0" />
|
||||||
{$_('toolbar.merge.merge_selection')}
|
{$_('toolbar.merge.merge_selection')}
|
||||||
</Button>
|
</Button>
|
||||||
<Help link="./help/toolbar/merge">
|
<Help link="./help/toolbar/merge">
|
||||||
|
@@ -3,7 +3,11 @@
|
|||||||
import { Button } from '$lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import { Slider } from '$lib/components/ui/slider';
|
import { Slider } from '$lib/components/ui/slider';
|
||||||
import { selection } from '$lib/components/file-list/Selection';
|
import { selection } from '$lib/components/file-list/Selection';
|
||||||
import { ListItem, ListRootItem, ListTrackSegmentItem } from '$lib/components/file-list/FileList';
|
import {
|
||||||
|
ListItem,
|
||||||
|
ListRootItem,
|
||||||
|
ListTrackSegmentItem
|
||||||
|
} from '$lib/components/file-list/FileList';
|
||||||
import Help from '$lib/components/Help.svelte';
|
import Help from '$lib/components/Help.svelte';
|
||||||
import { Filter } from 'lucide-svelte';
|
import { Filter } from 'lucide-svelte';
|
||||||
import { _ } from 'svelte-i18n';
|
import { _ } from 'svelte-i18n';
|
||||||
@@ -90,11 +94,17 @@
|
|||||||
});
|
});
|
||||||
$fileObservers.forEach((fileStore, fileId) => {
|
$fileObservers.forEach((fileStore, fileId) => {
|
||||||
if (!unsubscribes.has(fileId)) {
|
if (!unsubscribes.has(fileId)) {
|
||||||
let unsubscribe = derived([fileStore, selection], ([fs, sel]) => [fs, sel]).subscribe(
|
let unsubscribe = derived([fileStore, selection], ([fs, sel]) => [
|
||||||
([fs, sel]) => {
|
fs,
|
||||||
|
sel
|
||||||
|
]).subscribe(([fs, sel]) => {
|
||||||
if (fs) {
|
if (fs) {
|
||||||
fs.file.forEachSegment((segment, trackIndex, segmentIndex) => {
|
fs.file.forEachSegment((segment, trackIndex, segmentIndex) => {
|
||||||
let segmentItem = new ListTrackSegmentItem(fileId, trackIndex, segmentIndex);
|
let segmentItem = new ListTrackSegmentItem(
|
||||||
|
fileId,
|
||||||
|
trackIndex,
|
||||||
|
segmentIndex
|
||||||
|
);
|
||||||
if (sel.hasAnyParent(segmentItem)) {
|
if (sel.hasAnyParent(segmentItem)) {
|
||||||
let statistics = fs.statistics.getStatisticsFor(segmentItem);
|
let statistics = fs.statistics.getStatisticsFor(segmentItem);
|
||||||
simplified.set(segmentItem.getFullId(), [
|
simplified.set(segmentItem.getFullId(), [
|
||||||
@@ -109,8 +119,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
unsubscribes.set(fileId, unsubscribe);
|
unsubscribes.set(fileId, unsubscribe);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -153,11 +162,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<Label class="flex flex-row justify-between">
|
<Label class="flex flex-row justify-between">
|
||||||
<span>{$_('toolbar.reduce.tolerance')}</span>
|
<span>{$_('toolbar.reduce.tolerance')}</span>
|
||||||
<WithUnits value={tolerance / 1000} type="distance" decimals={3} />
|
<WithUnits value={tolerance / 1000} type="distance" decimals={3} class="font-normal" />
|
||||||
</Label>
|
</Label>
|
||||||
<Label class="flex flex-row justify-between">
|
<Label class="flex flex-row justify-between">
|
||||||
<span>{$_('toolbar.reduce.number_of_points')}</span>
|
<span>{$_('toolbar.reduce.number_of_points')}</span>
|
||||||
<span>{currentPoints}/{maxPoints}</span>
|
<span class="font-normal">{currentPoints}/{maxPoints}</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Button variant="outline" disabled={!validSelection} on:click={reduce}>
|
<Button variant="outline" disabled={!validSelection} on:click={reduce}>
|
||||||
<Filter size="16" class="mr-1" />
|
<Filter size="16" class="mr-1" />
|
||||||
|
@@ -293,11 +293,11 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="flex flex-row gap-2">
|
<div class="flex flex-row gap-2 items-center">
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
disabled={!canUpdate}
|
disabled={!canUpdate}
|
||||||
class="grow"
|
class="grow whitespace-normal h-fit"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
let effectiveSpeed = getSpeed();
|
let effectiveSpeed = getSpeed();
|
||||||
if (
|
if (
|
||||||
@@ -372,7 +372,7 @@
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CalendarClock size="16" class="mr-1" />
|
<CalendarClock size="16" class="mr-1 shrink-0" />
|
||||||
{$_('toolbar.time.update')}
|
{$_('toolbar.time.update')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="outline" on:click={setGPXData}>
|
<Button variant="outline" on:click={setGPXData}>
|
||||||
|
@@ -211,7 +211,7 @@
|
|||||||
<Label for="link">{$_('toolbar.waypoint.link')}</Label>
|
<Label for="link">{$_('toolbar.waypoint.link')}</Label>
|
||||||
<Input bind:value={link} id="link" class="h-8" />
|
<Input bind:value={link} id="link" class="h-8" />
|
||||||
<div class="flex flex-row gap-2">
|
<div class="flex flex-row gap-2">
|
||||||
<div>
|
<div class="grow">
|
||||||
<Label for="latitude">{$_('toolbar.waypoint.latitude')}</Label>
|
<Label for="latitude">{$_('toolbar.waypoint.latitude')}</Label>
|
||||||
<Input
|
<Input
|
||||||
bind:value={latitude}
|
bind:value={latitude}
|
||||||
@@ -220,10 +220,10 @@
|
|||||||
step={1e-6}
|
step={1e-6}
|
||||||
min={-90}
|
min={-90}
|
||||||
max={90}
|
max={90}
|
||||||
class="text-xs h-8"
|
class="text-xs h-8 "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="grow">
|
||||||
<Label for="longitude">{$_('toolbar.waypoint.longitude')}</Label>
|
<Label for="longitude">{$_('toolbar.waypoint.longitude')}</Label>
|
||||||
<Input
|
<Input
|
||||||
bind:value={longitude}
|
bind:value={longitude}
|
||||||
@@ -237,24 +237,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="flex flex-row flex-wrap gap-2">
|
<div class="flex flex-row gap-2 items-center">
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
disabled={!canCreate && !$selectedWaypoint}
|
disabled={!canCreate && !$selectedWaypoint}
|
||||||
class="grow"
|
class="grow whitespace-normal h-fit"
|
||||||
on:click={createOrUpdateWaypoint}
|
on:click={createOrUpdateWaypoint}
|
||||||
>
|
>
|
||||||
{#if $selectedWaypoint}
|
{#if $selectedWaypoint}
|
||||||
<Save size="16" class="mr-1" />
|
<Save size="16" class="mr-1 shrink-0" />
|
||||||
{$_('menu.metadata.save')}
|
{$_('menu.metadata.save')}
|
||||||
{:else}
|
{:else}
|
||||||
<CirclePlus size="16" class="mr-1" />
|
<CirclePlus size="16" class="mr-1 shrink-0" />
|
||||||
{$_('toolbar.waypoint.create')}
|
{$_('toolbar.waypoint.create')}
|
||||||
{/if}
|
{/if}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
class="ml-auto"
|
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
selectedWaypoint.set(undefined);
|
selectedWaypoint.set(undefined);
|
||||||
resetWaypointData();
|
resetWaypointData();
|
||||||
|
Reference in New Issue
Block a user