Skip to content

Commit 3818dd0

Browse files
committed
global and theme config
1 parent 735c74c commit 3818dd0

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/components/StatusArea.vue

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { computed, ref } from 'vue'
33
import { NModal, NSelect, NSpace } from 'naive-ui'
4-
import { GearButton, InputMethodConfig } from 'fcitx5-config-vue'
4+
import { GearButton, GlobalConfig, InputMethodConfig, ThemeConfig } from 'fcitx5-config-vue'
55
import { inputMethod, inputMethods, loading } from '../fcitx'
66
import MenuButton from './MenuButton.vue'
77
import GlobalButton from './GlobalButton.vue'
@@ -16,6 +16,13 @@ const options = computed(() => {
1616
})
1717
1818
const showModal = ref(false)
19+
const modalType = ref<'im' | 'global' | 'theme'>('im')
20+
21+
const titleMap = {
22+
im: 'Input Method Config',
23+
global: 'Global Config',
24+
theme: 'Theme Config',
25+
}
1926
</script>
2027

2128
<template>
@@ -26,21 +33,30 @@ const showModal = ref(false)
2633
:loading="loading"
2734
:options="options"
2835
/>
29-
<GearButton @click="showModal = true" />
36+
<GearButton @click="modalType = 'im'; showModal = true" />
3037
<MenuButton />
31-
<GlobalButton />
32-
<ThemeButton />
38+
<GlobalButton @click="modalType = 'global'; showModal = true" />
39+
<ThemeButton @click="modalType = 'theme'; showModal = true" />
3340
<AdvancedButton />
3441
<NModal
3542
v-model:show="showModal"
3643
preset="card"
37-
title="Input Method Config"
44+
:title="titleMap[modalType]"
3845
>
3946
<InputMethodConfig
47+
v-if="modalType === 'im'"
4048
:input-method="inputMethod"
4149
:input-methods="inputMethods"
4250
@close="showModal = false"
4351
/>
52+
<GlobalConfig
53+
v-else-if="modalType === 'global'"
54+
@close="showModal = false"
55+
/>
56+
<ThemeConfig
57+
v-else-if="modalType === 'theme'"
58+
@close="showModal = false"
59+
/>
4460
</NModal>
4561
</NSpace>
4662
</template>

0 commit comments

Comments
 (0)