support setting app font size

This commit is contained in:
MaysWind
2023-06-12 00:18:58 +08:00
parent 702c095544
commit dfb885f38d
23 changed files with 330 additions and 70 deletions
+23
View File
@@ -26,6 +26,17 @@
</select>
</f7-list-item>
<f7-list-item
:key="currentLocale + '_fontSize'"
:title="$t('Font Size')"
smart-select :smart-select-params="{ openIn: 'popup', popupPush: true, closeOnSelect: true, scrollToSelectedItem: true, searchbar: true, searchbarPlaceholder: $t('Font Size'), searchbarDisableText: $t('Cancel'), appendSearchbarNotFound: $t('No results'), popupCloseLinkText: $t('Done') }">
<select v-model="fontSize">
<option value="default">{{ $t('Default') }}</option>
<option value="large">{{ $t('Large') }}</option>
<option value="extraLarge">{{ $t('Extra Large') }}</option>
</select>
</f7-list-item>
<f7-list-item
:key="currentLocale + '_timezone'"
:title="$t('Timezone')"
@@ -102,6 +113,7 @@ import { useUserStore } from '@/stores/user.js';
import { useExchangeRatesStore } from '@/stores/exchangeRates.js';
import currencyConstants from '@/consts/currency.js';
import { setAppFontSize } from '@/lib/ui.mobile.js';
export default {
props: [
@@ -135,6 +147,17 @@ export default {
}
}
},
fontSize: {
get: function () {
return this.$settings.getFontSize();
},
set: function (value) {
if (value !== this.$settings.getFontSize()) {
this.$settings.setFontSize(value);
setAppFontSize(value);
}
}
},
currentTimezone: {
get: function () {
return this.$locale.getTimezone();