Archived
2
0

add layout select to settings

This commit is contained in:
Miroslav Šedivý 2020-06-15 22:09:01 +02:00
parent 5cf9c29319
commit c176411512
3 changed files with 56 additions and 0 deletions

View File

@ -35,6 +35,22 @@
<span /> <span />
</label> </label>
</li> </li>
<li>
<span>{{ $t('setting.keyboard_layout') }}</span>
<label class="select">
<select v-model="keyboard_layout">
<option value="us">English (US)</option>
<option value="gb">English (UK)</option>
<option value="de">German</option>
<option value="at">German (Austria)</option>
<option value="ch">German (Switzerland)</option>
<option value="sk">Slovak</option>
</select>
<span />
</label>
</li>
<li v-if="connected"> <li v-if="connected">
<button @click.stop.prevent="logout">{{ $t('logout') }}</button> <button @click.stop.prevent="logout">{{ $t('logout') }}</button>
</li> </li>
@ -182,6 +198,31 @@
} }
} }
} }
.select {
max-width: 120px;
select {
display: block;
width: 100%;
max-width: 100%;
padding: 4px;
margin: 0;
line-height: 30px;
font-weight: bold;
border: 0;
border-radius: 12px;
color: black;
background-color: $style-primary;
option {
font-weight: normal;
color: $text-normal;
background-color: $background-tertiary;
}
}
}
} }
} }
} }
@ -236,6 +277,14 @@
this.$accessor.settings.setSound(value) this.$accessor.settings.setSound(value)
} }
get keyboard_layout() {
return this.$accessor.settings.keyboard_layout
}
set keyboard_layout(value: string) {
this.$accessor.settings.setKeyboardLayout(value)
}
logout() { logout() {
this.$accessor.logout() this.$accessor.logout()
} }

View File

@ -60,6 +60,7 @@ export const setting = {
autoplay: 'Autoplay Video', autoplay: 'Autoplay Video',
ignore_emotes: 'Ignore Emotes', ignore_emotes: 'Ignore Emotes',
chat_sound: 'Play Chat Sound', chat_sound: 'Play Chat Sound',
keyboard_layout: 'Change Keyboard Layout',
} }
export const connection = { export const connection = {

View File

@ -10,6 +10,7 @@ export const state = () => {
autoplay: get<boolean>('autoplay', true), autoplay: get<boolean>('autoplay', true),
ignore_emotes: get<boolean>('ignore_emotes', false), ignore_emotes: get<boolean>('ignore_emotes', false),
chat_sound: get<boolean>('chat_sound', true), chat_sound: get<boolean>('chat_sound', true),
keyboard_layout: get<string>('keyboard_layout', 'us'),
} }
} }
@ -40,4 +41,9 @@ export const mutations = mutationTree(state, {
state.chat_sound = value state.chat_sound = value
set('chat_sound', value) set('chat_sound', value)
}, },
setKeyboardLayout(state, value: string) {
state.keyboard_layout = value
set('keyboard_layout', value)
},
}) })