renderer: add theme switcher, go to about page button in main screen

This commit is contained in:
leejooy96 committed 2022-07-12 09:24:25 +09:00
1 parent 72f2ef94a6
commit df3906c1cc
4 files changed
+62

No files matched your search

+5
View File
@@ -1,5 +1,10 @@
{
"desc": {
"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"
}
}
+5
View File
@@ -1,5 +1,10 @@
{
"desc": {
"welcome": "Vutron을 이용해주셔서 감사드립니다. 이 멋진 템플릿을 활용하면 다양한 크로스플랫폼 애플리케이션을 손쉽게 제작할 수 있습니다."
},
"menu": {
"change-theme": "테마 변경",
"change-language": "언어 변경",
"about": "Vutron 정보"
}
}
+6
View File
@@ -1,5 +1,11 @@
import { shell } from 'electron'
export default class Utils {
static getCurrentLocale () {
return navigator?.language?.split('-')[0] || 'en'
}
static async openExternal (url) {
await shell.openExternal(url)
}
}
@@ -1,4 +1,22 @@
<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>
<template>
@@ -17,6 +35,34 @@
<v-col cols="12">
{{ $t('desc.welcome') }}
</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-container>
</template>