fix(ui): give canvas zoom controls tooltips and larger hit targets
This commit is contained in:
1 file changed
+22
-4
@@ -2,9 +2,9 @@
|
||||
import { computed, nextTick, ref, watch } from "vue";
|
||||
import { VueFlow, type NodeMouseEvent, type VueFlowStore } from "@vue-flow/core";
|
||||
import { Background } from "@vue-flow/background";
|
||||
import { Controls } from "@vue-flow/controls";
|
||||
import { ControlButton, Controls } from "@vue-flow/controls";
|
||||
import { usePreferredReducedMotion, useTransition } from "@vueuse/core";
|
||||
import { ArrowDown, ArrowUp, Copy, Pencil, RotateCcw, Trash2 } from "@lucide/vue";
|
||||
import { ArrowDown, ArrowUp, Copy, Maximize, Minus, Pencil, Plus, RotateCcw, Trash2 } from "@lucide/vue";
|
||||
import "@vue-flow/core/dist/style.css";
|
||||
import "@vue-flow/controls/dist/style.css";
|
||||
|
||||
@@ -289,7 +289,17 @@ const beforePath = computed(() => menuPath.value ? [...menuPath.value.slice(0, -
|
||||
<InsertEdge v-bind="edgeProps" />
|
||||
</template>
|
||||
<Background :gap="20" />
|
||||
<Controls :show-interactive="false" />
|
||||
<Controls :show-interactive="false">
|
||||
<template #control-zoom-in>
|
||||
<ControlButton title="Zoom in" aria-label="Zoom in" @click="flow?.zoomIn()"><Plus /></ControlButton>
|
||||
</template>
|
||||
<template #control-zoom-out>
|
||||
<ControlButton title="Zoom out" aria-label="Zoom out" @click="flow?.zoomOut()"><Minus /></ControlButton>
|
||||
</template>
|
||||
<template #control-fit-view>
|
||||
<ControlButton title="Fit view" aria-label="Fit view" @click="flow?.fitView()"><Maximize /></ControlButton>
|
||||
</template>
|
||||
</Controls>
|
||||
</VueFlow>
|
||||
|
||||
<DropdownMenu v-model:open="menu.open">
|
||||
@@ -374,9 +384,17 @@ const beforePath = computed(() => menuPath.value ? [...menuPath.value.slice(0, -
|
||||
box-shadow: none;
|
||||
}
|
||||
.workflow-canvas .vue-flow__controls-button {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
padding: 0.5rem;
|
||||
background: var(--color-card);
|
||||
border-color: var(--color-border);
|
||||
fill: var(--color-foreground);
|
||||
color: var(--color-foreground);
|
||||
}
|
||||
.workflow-canvas .vue-flow__controls-button svg {
|
||||
max-width: 1rem;
|
||||
max-height: 1rem;
|
||||
fill: none;
|
||||
}
|
||||
.workflow-canvas .vue-flow__controls-button:hover {
|
||||
background: var(--color-secondary);
|
||||
|
||||
Reference in new issue
Block a user