-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PB-1297: make position of text labels configurable
- Loading branch information
Showing
13 changed files
with
342 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/modules/infobox/components/styling/DrawingStylePlacementSelector.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<template> | ||
<div> | ||
<label class="form-label" for="drawing-style-text-placement-selector"> | ||
{{ i18n.t('modify_text_placement_label') }} | ||
</label> | ||
<div class="grid-container"> | ||
<div class="grid"> | ||
<button | ||
v-for="pos in allStylingTextPlacements" | ||
:key="pos" | ||
:data-cy="`drawing-style-placement-selector-${pos}`" | ||
class="placement-button btn btn-sm btn-light btn-outline-secondary" | ||
:class="{ active: currentPlacement === pos }" | ||
@click="onPlacementSelect(pos)" | ||
></button> | ||
</div> | ||
<div class="floating-box"></div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { toRefs } from 'vue' | ||
import { useI18n } from 'vue-i18n' | ||
import { allStylingTextPlacements } from '@/utils/featureStyleUtils' | ||
const props = defineProps({ | ||
currentPlacement: { | ||
type: String, | ||
required: true, | ||
}, | ||
}) | ||
const { currentPlacement } = toRefs(props) | ||
const emit = defineEmits(['change']) | ||
const i18n = useI18n() | ||
const onPlacementSelect = (placement) => { | ||
emit('change', placement) | ||
} | ||
</script> | ||
|
||
<style> | ||
.grid-container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
position: relative; | ||
} | ||
.grid { | ||
display: grid; | ||
grid-template-columns: repeat(3, auto); | ||
gap: 5px; | ||
} | ||
.floating-box { | ||
width: 52px; | ||
height: 52px; | ||
position: absolute; | ||
top: 12%; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
z-index: 1; | ||
border: 2px solid black; | ||
} | ||
.placement-button { | ||
z-index: 2; | ||
height: 20px; | ||
width: 20px; | ||
position: relative; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.