Skip to content

Commit

Permalink
Allow searching for icon name in the GenericIndicator mini-widget
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Aug 9, 2023
1 parent 3a72df6 commit 57c7767
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components/mini-widgets/GenericIndicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@
/>
</div>
</div>
<div class="flex items-center justify-center w-full mt-2">
<input
v-model="iconSearchString"
class="w-40 px-2 py-1 rounded-md bg-slate-200"
placeholder="Search icons..."
/>
</div>
<RecycleScroller
v-if="iconSearchString === ''"
v-slot="{ item }"
class="w-full h-40 mt-3"
:items="iconsNames.filter((name) => name.includes(iconSearchString))"
Expand All @@ -46,6 +54,15 @@
<span class="m-1 text-white cursor-pointer mdi icon-symbol" :class="[item]" @click="options.iconName = item">
</span>
</RecycleScroller>
<div v-else class="grid w-full h-40 grid-cols-6 mt-3 overflow-x-hidden overflow-y-scroll">
<span
v-for="icon in iconsNames.filter((name) => name.includes(iconSearchString))"
:key="icon"
class="m-1 text-white cursor-pointer mdi icon-symbol"
:class="[icon]"
@click="options.iconName = icon"
/>
</div>
</div>
</div>
</Dialog>
Expand Down Expand Up @@ -100,6 +117,7 @@ watch(options, updateVariableState)
let iconsNames: string[] = []
const showConfigurationMenu = ref(false)
const iconSearchString = ref('')
</script>

<style>
Expand Down

0 comments on commit 57c7767

Please sign in to comment.