renderer: add theme switcher, go to about page button in main screen
This commit is contained in:
1 parent
72f2ef94a6
commit
df3906c1cc
4 files changed
+62
No files matched your search
@@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"desc": {
|
"desc": {
|
||||||
"welcome": "Thank you for using Vutron. This cool template makes it easy to create a variety of cross-platform applications."
|
"welcome": "Thank you for using Vutron. This cool template makes it easy to create a variety of cross-platform applications."
|
||||||
|
},
|
||||||
|
"menu": {
|
||||||
|
"change-theme": "Change Theme",
|
||||||
|
"change-language": "Change Language",
|
||||||
|
"about": "About Vutron"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"desc": {
|
"desc": {
|
||||||
"welcome": "Vutron을 이용해주셔서 감사드립니다. 이 멋진 템플릿을 활용하면 다양한 크로스플랫폼 애플리케이션을 손쉽게 제작할 수 있습니다."
|
"welcome": "Vutron을 이용해주셔서 감사드립니다. 이 멋진 템플릿을 활용하면 다양한 크로스플랫폼 애플리케이션을 손쉽게 제작할 수 있습니다."
|
||||||
|
},
|
||||||
|
"menu": {
|
||||||
|
"change-theme": "테마 변경",
|
||||||
|
"change-language": "언어 변경",
|
||||||
|
"about": "Vutron 정보"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
|
import { shell } from 'electron'
|
||||||
|
|
||||||
export default class Utils {
|
export default class Utils {
|
||||||
static getCurrentLocale () {
|
static getCurrentLocale () {
|
||||||
return navigator?.language?.split('-')[0] || 'en'
|
return navigator?.language?.split('-')[0] || 'en'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async openExternal (url) {
|
||||||
|
await shell.openExternal(url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,22 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
// import { useI18n } from 'vue-i18n'
|
||||||
|
import { useTheme } from 'vuetify'
|
||||||
|
import Utils from '../../assets/js/utils'
|
||||||
|
|
||||||
|
// const { locale } = useI18n()
|
||||||
|
const theme = useTheme()
|
||||||
|
|
||||||
|
const handleChangeTheme = () => {
|
||||||
|
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleChangeLanguage = () => {
|
||||||
|
// locale.value = 'en' // TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleAbout = async () => {
|
||||||
|
await Utils.openExternal('https://github.com/jooy2/vutron')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -17,6 +35,34 @@
|
|||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
{{ $t('desc.welcome') }}
|
{{ $t('desc.welcome') }}
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<v-col cols="4">
|
||||||
|
<v-btn
|
||||||
|
block
|
||||||
|
color="primary"
|
||||||
|
@click="handleChangeTheme"
|
||||||
|
>
|
||||||
|
{{ $t('menu.change-theme') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="4">
|
||||||
|
<v-btn
|
||||||
|
block
|
||||||
|
disabled
|
||||||
|
color="primary"
|
||||||
|
@click="handleChangeLanguage"
|
||||||
|
>
|
||||||
|
{{ $t('menu.change-language') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="4">
|
||||||
|
<v-btn
|
||||||
|
block
|
||||||
|
color="primary"
|
||||||
|
@click="handleAbout"
|
||||||
|
>
|
||||||
|
{{ $t('menu.about') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
Reference in new issue
Block a user