11<script setup lang="ts">
22import { ref , computed , onMounted } from ' vue'
33import { useI18n } from ' vue-i18n'
4- import { Button , Select , Range } from ' @munet/ui'
4+ import { Button , Select } from ' @munet/ui'
55import { selectedThemeHue , selectedThemeName , UIThemes } from ' @munet/ui'
66import type { SelectOption } from ' @munet/ui'
7- import { apiClient , isWebView } from ' @/api'
7+ import { apiClient } from ' @/api'
88import { setStatus } from ' @/store/status'
99import { availableLocales , localeLabels , setLocale , locale } from ' @/locales'
1010import type { Locale } from ' @/locales'
@@ -16,27 +16,9 @@ const historyPaths = ref<string[]>([])
1616const switching = ref (false )
1717const error = ref (' ' )
1818
19- const uiZoom = ref (0 )
20- const autoZoom = 100
21-
22- const zoomDisplay = computed ({
23- get : () => uiZoom .value || autoZoom ,
24- set : (v : number ) => {
25- uiZoom .value = v
26- postZoom (v )
27- }
28- })
29-
30- function postZoom(value : number ) {
31- if (isWebView ) {
32- ;(window as any ).chrome .webview .postMessage (JSON .stringify ({ type: ' setZoom' , value }))
33- }
34- }
35-
3619const themeOptions = computed <SelectOption []>(() => [
3720 { label: t (' settings.themeAuto' ), value: UIThemes .Auto },
3821 { label: t (' settings.themeLight' ), value: UIThemes .DynamicLight },
39- { label: t (' settings.themeDark' ), value: UIThemes .Dark },
4022])
4123
4224const localeOptions = computed (() =>
@@ -55,11 +37,6 @@ function resetHue() {
5537 selectedThemeHue .value = 353
5638}
5739
58- function resetZoom() {
59- uiZoom .value = 0
60- postZoom (0 )
61- }
62-
6340async function handleChangeDirectory() {
6441 error .value = ' '
6542 try {
@@ -125,19 +102,6 @@ async function deleteHistory(path: string) {
125102 />
126103 <Button @click =" resetHue " class="shrink-0">{{ t('settings.reset') }}</Button >
127104 </div >
128- <div v-if =" isWebView" class =" flex items-center gap-2" >
129- <span class =" shrink-0 op-60" >{{ t('settings.zoom') }}</span >
130- <input
131- type =" range" min =" 50" max =" 250" step =" 5"
132- :value =" zoomDisplay"
133- @input =" (e: Event) => zoomDisplay = Number((e.target as HTMLInputElement).value)"
134- class =" flex-1"
135- />
136- <span class =" ml-auto shrink-0 text-sm op-60 w-12" >
137- {{ uiZoom === 0 ? t('settings.zoomAuto') : `${uiZoom}%` }}
138- </span >
139- <Button @click =" resetZoom " class="shrink-0">{{ t('settings.reset') }}</Button >
140- </div >
141105 <div class =" flex items-center gap-3" >
142106 <span class =" shrink-0 op-60" >{{ t('settings.language') }}</span >
143107 <Select :options =" localeOptions " :value =" locale " @change =" (v : any ) => setLocale (v as Locale ) " />
0 commit comments