diff --git a/app/components/designer/DesignerToolbar.vue b/app/components/designer/DesignerToolbar.vue index 4217144..ba39e76 100644 --- a/app/components/designer/DesignerToolbar.vue +++ b/app/components/designer/DesignerToolbar.vue @@ -9,8 +9,10 @@ const props = defineProps<{ onImportImage: (file: File) => Promise; onFillChange: (fill: string) => void; onStrokeChange: (stroke: string) => void; + onBackgroundChange: (background: string) => void; activeFill: string | null; activeStroke: string | null; + activeBackground: string; canStyleSelection: boolean; zoom: number; minZoom: number; @@ -28,6 +30,7 @@ const emit = defineEmits<{ const fileInput = ref(null); const fillValue = ref(props.activeFill ?? "#111827"); const strokeValue = ref(props.activeStroke ?? "#3b82f6"); +const backgroundValue = ref(props.activeBackground ?? "#ffffff"); const zoomSliderValue = ref(Math.round(props.zoom * 100)); watch( @@ -44,6 +47,13 @@ watch( } ); +watch( + () => props.activeBackground, + (next) => { + backgroundValue.value = next ?? "#ffffff"; + } +); + watch( () => props.zoom, (next) => { @@ -88,6 +98,13 @@ const handleStrokeChange = (event: Event) => { props.onStrokeChange(value); }; +const handleBackgroundChange = (event: Event) => { + const input = event.target as HTMLInputElement; + const value = input.value; + backgroundValue.value = value; + props.onBackgroundChange(value); +}; + const handleZoomInput = (event: Event) => { const input = event.target as HTMLInputElement; const value = Number(input.value); @@ -141,6 +158,15 @@ const zoomLabel = computed(() => `${Math.round(props.zoom * 100)}%`);
+