Commit d22dc7a9 authored by Luna Riegel's avatar Luna Riegel
Browse files

Change button layout of the object-library

parent 01d4b50c
...@@ -7,26 +7,25 @@ ...@@ -7,26 +7,25 @@
</template> </template>
<template #default> <template #default>
<v-expansion-panels multiple> <v-expansion-panels multiple>
<VcsExpansionPanel v-for = "(subcats, categoryName) in objLib" :key="categoryName" :heading="categoryName"> <VcsExpansionPanel v-for = "(subcats, categoryName) in objLib" :key="categoryName" :heading="categoryName" >
<v-container v-for="(entries, subCategory) in subcats" :key = "subCategory" class=" py-1 px-1 border-b-md"> <v-container class="px-1 py-0">
<v-col> <v-row class="v-row--no-gutters">
<VcsLabel class="mb-4 text-h2">{{subCategory}}</VcsLabel> <template v-for="(entries, subCategory) in subcats" :key = "subCategory">
<v-list>
<v-row>
<vcs-button <vcs-button
v-for="entry in entries" v-for="entry in entries"
:key="entry.title" :key="entry.title"
@click="placeCatalogModel(entry.model)" @click="placeCatalogModel(entry.model)"
class="p-0 mx-1 my-0 border gc-2" class="p-0 mx-1 my-1 border gc-2"
style="width: auto; height: auto; margin-left: 1rem; margin-bottom: 1px;" style="width: 66px; height: 66px; margin-left: 1rem; margin-bottom: 1px;"
variant="filled" color="base-lighter-4"
variant="tonal"
:tooltip="getEntryTooltip(entry, subCategory)"
> >
<img :src="entry.icon" :alt="entry.icon" style="display: block; max-width: 100%; max-height: 100%;" /> <img :src="entry.icon" :alt="entry.icon" style="display: block; width: 64px; height: 64px;" />
</vcs-button> </vcs-button>
</v-row>
</v-list>
</v-col>
<v-divider/> <v-divider/>
</template>
</v-row>
</v-container> </v-container>
</VcsExpansionPanel> </VcsExpansionPanel>
</v-expansion-panels> </v-expansion-panels>
...@@ -217,6 +216,15 @@ function getCatalogEntries(json, linkPrefix) { ...@@ -217,6 +216,15 @@ function getCatalogEntries(json, linkPrefix) {
return part; return part;
} }
export function getEntryTooltip (entry, subcategory) {
let tooltip = 'Kategorie: ';
const category = subcategory || 'Unbekannt';
tooltip += category;
return tooltip;
}
async function placeCatalogModel(modelLink){ async function placeCatalogModel(modelLink){
loadCatalogModel(modelLink).then(model => { loadCatalogModel(modelLink).then(model => {
const catModel = model; const catModel = model;
...@@ -541,6 +549,9 @@ function uploadModel() { ...@@ -541,6 +549,9 @@ function uploadModel() {
saveConfiguration() { saveConfiguration() {
saveObjects(); saveObjects();
}, },
getEntryTooltip(entry, subcategory) {
return getEntryTooltip(entry, subcategory);
},
}; };
}, },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment