Improve usability

This commit is contained in:
syuilo 2018-10-08 15:23:10 +09:00
parent 9b3af6efcd
commit 567cedc7cc
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
4 changed files with 25 additions and 3 deletions

View file

@ -288,6 +288,8 @@ common/views/components/media-banner.vue:
common/views/components/theme.vue:
light-theme: "非ダークモード時に使用するテーマ"
dark-theme: "ダークモード時に使用するテーマ"
light-themes: "明るいテーマ"
dark-themes: "暗いテーマ"
install-a-theme: "テーマのインストール"
theme-code: "テーマコード"
install: "インストール"

View file

@ -3,14 +3,24 @@
<label>
<span>%i18n:@light-theme%</span>
<ui-select v-model="light" placeholder="%i18n:@light-theme%">
<option v-for="x in themes" :value="x.id" :key="x.id">{{ x.name }}</option>
<optgroup label="%i18n:@light-themes%">
<option v-for="x in lightThemes" :value="x.id" :key="x.id">{{ x.name }}</option>
</optgroup>
<optgroup label="%i18n:@dark-themes%">
<option v-for="x in darkThemes" :value="x.id" :key="x.id">{{ x.name }}</option>
</optgroup>
</ui-select>
</label>
<label>
<span>%i18n:@dark-theme%</span>
<ui-select v-model="dark" placeholder="%i18n:@dark-theme%">
<option v-for="x in themes" :value="x.id" :key="x.id">{{ x.name }}</option>
<optgroup label="%i18n:@dark-themes%">
<option v-for="x in darkThemes" :value="x.id" :key="x.id">{{ x.name }}</option>
</optgroup>
<optgroup label="%i18n:@light-themes%">
<option v-for="x in lightThemes" :value="x.id" :key="x.id">{{ x.name }}</option>
</optgroup>
</ui-select>
</label>
@ -120,7 +130,15 @@ export default Vue.extend({
computed: {
themes(): Theme[] {
return this.$store.state.device.themes.concat(builtinThemes);
return builtinThemes.concat(this.$store.state.device.themes);
},
darkThemes(): Theme[] {
return this.themes.filter(t => t.base == 'dark' || t.kind == 'dark');
},
lightThemes(): Theme[] {
return this.themes.filter(t => t.base == 'light' || t.kind == 'light');
},
installedThemes(): Theme[] {

View file

@ -4,6 +4,7 @@
name: 'Dark',
author: 'syuilo',
desc: 'Default dark theme',
kind: 'dark',
vars: {
primary: '#fb4e4e',

View file

@ -4,6 +4,7 @@
name: 'Light',
author: 'syuilo',
desc: 'Default light theme',
kind: 'light',
vars: {
primary: '#fb4e4e',