added Toggle Grid/List View into the spotlight

This commit is contained in:
Čarodej
2022-01-06 15:05:45 +01:00
parent 31ec9b4fda
commit 86dac75071
8 changed files with 45 additions and 19 deletions

View File

@@ -99,6 +99,7 @@
<maximize2-icon v-if="result.action.value === 'full-screen-mode'" size="18" class="vue-feather text-theme"/>
<power-icon v-if="result.action.value === 'log-out'" size="18" class="vue-feather text-theme"/>
<trash-icon v-if="result.action.value === 'empty-trash'" size="18" class="vue-feather text-theme"/>
<grid-icon v-if="result.action.value === 'toggle-grid-list'" size="18" class="vue-feather text-theme"/>
<b class="font-bold text-sm ml-3.5">
{{ result.title }}
@@ -187,6 +188,7 @@
<script>
import {
GridIcon,
Maximize2Icon,
ArrowDownIcon,
ArrowUpIcon,
@@ -225,6 +227,7 @@ import axios from "axios"
export default {
name: 'Spotlight',
components: {
GridIcon,
CategoryName,
FilterSuggestion,
Maximize2Icon,
@@ -424,6 +427,13 @@ export default {
]
let functionList = [
{
title: this.$t('Toggle Grid/List View'),
action: {
type: 'function',
value: 'toggle-grid-list',
},
},
{
title: this.$t('Toggle Dark/Light Mode'),
action: {
@@ -564,6 +574,10 @@ export default {
if (arg.action.type === 'function') {
if (arg.action.value === 'toggle-grid-list') {
this.$store.dispatch('togglePreviewType')
}
if (arg.action.value === 'dark-mode') {
this.$store.dispatch('toggleDarkMode', !this.isDarkMode)
}