Commit 72326cf2 authored by schneider210's avatar schneider210
Browse files

feat: make the theme switch toggleable

parent fbcc6c81
Pipeline #223499 passed with stages
in 4 minutes and 11 seconds
......@@ -22,20 +22,14 @@
>
<q-item-section>{{ $t('default') }}</q-item-section>
</q-item>
<q-item
v-if="projectcolors.primary && projectcolors.secondary && projectcolors.accent"
v-close-popup
clickable
@click="changeColorsTo('emo')"
>
<q-item-section>EMo</q-item-section>
</q-item>
<q-item
v-close-popup
clickable
@click="changeColorsTo('unicorn')"
@click="changeColorsTo('tido')"
>
<q-item-section>Unicorn</q-item-section>
<q-item-section>TIDO</q-item-section>
</q-item>
</q-list>
</q-menu>
......@@ -61,25 +55,13 @@ export default {
methods: {
changeColorsTo(color) {
if (color === 'default') {
if (this.projectcolors.primary && this.projectcolors.secondary && this.projectcolors.accent) {
colors.setBrand('primary', this.projectcolors.primary);
colors.setBrand('secondary', this.projectcolors.secondary);
colors.setBrand('accent', this.projectcolors.accent);
} else {
colors.setBrand('primary', this.$q.config.brand.primary);
colors.setBrand('secondary', this.$q.config.brand.secondary);
colors.setBrand('accent', this.$q.config.brand.accent);
}
}
if (color === 'emo') {
colors.setBrand('primary', this.$q.config.brand.primary);
colors.setBrand('secondary', this.$q.config.brand.secondary);
colors.setBrand('accent', this.$q.config.brand.accent);
}
if (color === 'unicorn') {
colors.setBrand('primary', 'purple');
colors.setBrand('secondary', 'lightgrey');
colors.setBrand('accent', 'hotpink');
} else if (color === 'tido' && this.projectcolors.primary && this.projectcolors.secondary && this.projectcolors.accent) {
colors.setBrand('primary', this.projectcolors.primary);
colors.setBrand('secondary', this.projectcolors.secondary);
colors.setBrand('accent', this.projectcolors.accent);
}
},
},
......
......@@ -5,21 +5,24 @@
:config="config"
/>
<!-- <Color :projectcolors="projectcolors" /> -->
<Color
v-if="config.themes && projectColorsSet"
:projectcolors="projectcolors"
/>
<Softwareinfo />
</div>
</template>
<script>
// import Color from '@/components/color.vue';
import Color from '@/components/color.vue';
import Language from '@/components/language.vue';
import Softwareinfo from '@/components/softwareinfo.vue';
export default {
name: 'Tools',
components: {
// Color,
Color,
Language,
Softwareinfo,
},
......@@ -34,5 +37,10 @@ export default {
},
standalone: Boolean,
},
computed: {
projectColorsSet() {
return !!Object.values(this.projectcolors).some((color) => color !== null && color !== '');
},
},
};
</script>
......@@ -121,6 +121,7 @@
"rtl": false,
"lang": "en-us",
"standalone": true,
"themes": false,
"breadcrumbNavigation": {
"show": true,
"title_homepage_key": "title_homepage",
......
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