Skip to content

Commit 1c98887

Browse files
committed
plugin manager
1 parent c148739 commit 1c98887

File tree

5 files changed

+46
-3
lines changed

5 files changed

+46
-3
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
.DS_Store
12
node_modules
23
pnpm-lock.yaml
34
dist
45
*.tgz
6+
*.zip

src/App.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
darkTheme,
44
NConfigProvider,
55
NH1,
6+
NMessageProvider,
67
NModalProvider,
78
useOsTheme,
89
} from 'naive-ui'
@@ -26,7 +27,9 @@ const osThemeRef = useOsTheme()
2627
<NH1>{{ appName }}</NH1>
2728
</div>
2829
<NModalProvider>
29-
<MyContent />
30+
<NMessageProvider>
31+
<MyContent />
32+
</NMessageProvider>
3033
</NModalProvider>
3134
</template>
3235
<template #footer>

src/components/PlugIcon.vue

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script lang="ts">
2+
export default {
3+
name: 'MaterialSymbolsPowerPlugOutlineRounded',
4+
}
5+
</script>
6+
7+
<template>
8+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M11.5 19h1v-1.85l3.5-3.5V9H8v4.65l3.5 3.5zm-2 1v-2l-2.925-2.925q-.275-.275-.425-.637T6 13.675V9q0-.825.588-1.412T8 7h1L8 8V4q0-.425.288-.712T9 3t.713.288T10 4v3h4V4q0-.425.288-.712T15 3t.713.288T16 4v4l-1-1h1q.825 0 1.413.588T18 9v4.675q0 .4-.15.763t-.425.637L14.5 18v2q0 .425-.288.713T13.5 21h-3q-.425 0-.712-.288T9.5 20m2.5-6" /></svg>
9+
</template>

src/components/PluginButton.vue

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script setup lang="ts">
2+
import { NButton, NIcon } from 'naive-ui'
3+
import PlugIcon from './PlugIcon.vue'
4+
</script>
5+
6+
<template>
7+
<NButton
8+
secondary
9+
>
10+
<template #icon>
11+
<NIcon>
12+
<PlugIcon />
13+
</NIcon>
14+
</template>
15+
</NButton>
16+
</template>

src/components/StatusArea.vue

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<script setup lang="ts">
2-
import { AdvancedConfig, GearButton, GlobalConfig, InputMethodConfig, ThemeConfig } from 'fcitx5-config-vue'
2+
import { AdvancedConfig, GearButton, GlobalConfig, InputMethodConfig, PluginManager, ThemeConfig } from 'fcitx5-config-vue'
33
import { NModal, NSelect, NSpace, NTooltip } from 'naive-ui'
44
import { computed, ref } from 'vue'
55
import { inputMethod, inputMethods, loading } from '../fcitx'
66
import AdvancedButton from './AdvancedButton.vue'
77
import GlobalButton from './GlobalButton.vue'
88
import MenuButton from './MenuButton.vue'
9+
import PluginButton from './PluginButton.vue'
910
import ThemeButton from './ThemeButton.vue'
1011
1112
const options = computed(() => {
@@ -16,12 +17,13 @@ const options = computed(() => {
1617
})
1718
1819
const showModal = ref(false)
19-
const modalType = ref<'im' | 'global' | 'theme' | 'advanced'>('im')
20+
const modalType = ref<'im' | 'global' | 'theme' | 'plugin' | 'advanced'>('im')
2021
2122
const titleMap = {
2223
im: 'Input Method',
2324
global: 'Global Config',
2425
theme: 'Theme Editor',
26+
plugin: 'Plugin Manager',
2527
advanced: 'Advanced',
2628
}
2729
</script>
@@ -53,6 +55,12 @@ const titleMap = {
5355
</template>
5456
{{ titleMap.theme }}
5557
</NTooltip>
58+
<NTooltip>
59+
<template #trigger>
60+
<PluginButton @click="modalType = 'plugin'; showModal = true" />
61+
</template>
62+
{{ titleMap.plugin }}
63+
</NTooltip>
5664
<NTooltip>
5765
<template #trigger>
5866
<AdvancedButton @click="modalType = 'advanced'; showModal = true" />
@@ -61,6 +69,7 @@ const titleMap = {
6169
</NTooltip>
6270
<NModal
6371
v-model:show="showModal"
72+
:style="modalType === 'plugin' ? 'width: auto' : 'max-width: 1024px'"
6473
preset="card"
6574
:title="titleMap[modalType]"
6675
>
@@ -78,6 +87,10 @@ const titleMap = {
7887
v-else-if="modalType === 'theme'"
7988
@close="showModal = false"
8089
/>
90+
<PluginManager
91+
v-else-if="modalType === 'plugin'"
92+
@close="showModal = false"
93+
/>
8194
<AdvancedConfig
8295
v-else
8396
@close="showModal = false"

0 commit comments

Comments
 (0)