Improve mobile settings

This commit is contained in:
syuilo 2018-05-20 17:37:30 +09:00
parent 42849da497
commit f6449a7f32
6 changed files with 34 additions and 3 deletions

View file

@ -810,6 +810,7 @@ mobile/views/pages/settings/settings.profile.vue:
title: "プロフィール" title: "プロフィール"
will-be-published: "これらのプロフィールは公開されます。" will-be-published: "これらのプロフィールは公開されます。"
name: "名前" name: "名前"
account: "アカウント"
location: "場所" location: "場所"
description: "自己紹介" description: "自己紹介"
birthday: "誕生日" birthday: "誕生日"
@ -837,6 +838,7 @@ mobile/views/pages/settings.vue:
specify-language: "言語を指定" specify-language: "言語を指定"
design: "デザインと表示" design: "デザインと表示"
dark-mode: "ダークモード" dark-mode: "ダークモード"
i-am-under-limited-internet: "私は通信を制限されている"
circle-icons: "円形のアイコンを使用" circle-icons: "円形のアイコンを使用"
timeline: "タイムライン" timeline: "タイムライン"
show-reply-target: "リプライ先を表示する" show-reply-target: "リプライ先を表示する"

View file

@ -21,10 +21,13 @@ export default Vue.extend({
} }
}, },
computed: { computed: {
lightmode(): boolean {
return localStorage.getItem('lightmode') == 'true';
},
style(): any { style(): any {
return { return {
backgroundColor: this.user.avatarColor && this.user.avatarColor.length == 3 ? `rgb(${ this.user.avatarColor.join(',') })` : null, backgroundColor: this.user.avatarColor && this.user.avatarColor.length == 3 ? `rgb(${ this.user.avatarColor.join(',') })` : null,
backgroundImage: `url(${ this.user.avatarUrl }?thumbnail)`, backgroundImage: this.lightmode ? null : `url(${ this.user.avatarUrl }?thumbnail)`,
borderRadius: (this as any).clientSettings.circleIcons ? '100%' : null borderRadius: (this as any).clientSettings.circleIcons ? '100%' : null
}; };
} }

View file

@ -16,10 +16,13 @@ export default Vue.extend({
} }
}, },
computed: { computed: {
lightmode(): boolean {
return localStorage.getItem('lightmode') == 'true';
},
style(): any { style(): any {
return { return {
'background-color': this.image.properties.avgColor && this.image.properties.avgColor.length == 3 ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent', 'background-color': this.image.properties.avgColor && this.image.properties.avgColor.length == 3 ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
'background-image': this.raw ? `url(${this.image.url})` : `url(${this.image.url}?thumbnail&size=512)` 'background-image': this.lightmode ? null : this.raw ? `url(${this.image.url})` : `url(${this.image.url}?thumbnail&size=512)`
}; };
} }
} }

View file

@ -51,6 +51,10 @@
<div> <div>
<md-switch v-model="clientSettings.disableViaMobile" @change="onChangeDisableViaMobile">%i18n:@disable-via-mobile%</md-switch> <md-switch v-model="clientSettings.disableViaMobile" @change="onChangeDisableViaMobile">%i18n:@disable-via-mobile%</md-switch>
</div> </div>
<div>
<md-switch v-model="lightmode">%i18n:@i-am-under-limited-internet%</md-switch>
</div>
</md-card-content> </md-card-content>
</md-card> </md-card>
@ -134,6 +138,7 @@ export default Vue.extend({
version, version,
codename, codename,
darkmode: localStorage.getItem('darkmode') == 'true', darkmode: localStorage.getItem('darkmode') == 'true',
lightmode: localStorage.getItem('lightmode') == 'true',
lang: localStorage.getItem('lang') || '', lang: localStorage.getItem('lang') || '',
latestVersion: undefined, latestVersion: undefined,
checkingForUpdate: false checkingForUpdate: false
@ -150,6 +155,11 @@ export default Vue.extend({
darkmode() { darkmode() {
(this as any)._updateDarkmode_(this.darkmode); (this as any)._updateDarkmode_(this.darkmode);
}, },
lightmode() {
localStorage.setItem('lightmode', this.lightmode);
},
lang() { lang() {
localStorage.setItem('lang', this.lang); localStorage.setItem('lang', this.lang);
} }

View file

@ -10,6 +10,13 @@
<md-input v-model="name" :disabled="saving"/> <md-input v-model="name" :disabled="saving"/>
</md-field> </md-field>
<md-field>
<label>%i18n:@account%</label>
<span class="md-prefix">@</span>
<md-input v-model="username" readonly></md-input>
<span class="md-suffix">@{{ host }}</span>
</md-field>
<md-field> <md-field>
<md-icon>%fa:map-marker-alt%</md-icon> <md-icon>%fa:map-marker-alt%</md-icon>
<label>%i18n:@location%</label> <label>%i18n:@location%</label>
@ -54,12 +61,14 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import { apiUrl } from '../../../../config'; import { apiUrl, host } from '../../../../config';
export default Vue.extend({ export default Vue.extend({
data() { data() {
return { return {
host,
name: null, name: null,
username: null,
location: null, location: null,
description: null, description: null,
birthday: null, birthday: null,
@ -72,6 +81,7 @@ export default Vue.extend({
created() { created() {
this.name = (this as any).os.i.name || ''; this.name = (this as any).os.i.name || '';
this.username = (this as any).os.i.username;
this.location = (this as any).os.i.profile.location; this.location = (this as any).os.i.profile.location;
this.description = (this as any).os.i.description; this.description = (this as any).os.i.description;
this.birthday = (this as any).os.i.profile.birthday; this.birthday = (this as any).os.i.profile.birthday;

View file

@ -1,3 +1,6 @@
input
min-width 0px
input:not([type]) input:not([type])
input[type='text'] input[type='text']
input[type='password'] input[type='password']