fields for user font overrides
This commit is contained in:
parent
925fd863fe
commit
80cbf29bdf
|
@ -30,7 +30,7 @@ export default {
|
||||||
emits: ['update:modelValue'],
|
emits: ['update:modelValue'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
manualEntry: true,
|
manualEntry: false,
|
||||||
availableOptions: [
|
availableOptions: [
|
||||||
this.noInherit ? '' : 'inherit',
|
this.noInherit ? '' : 'inherit',
|
||||||
'serif',
|
'serif',
|
||||||
|
|
|
@ -4,6 +4,8 @@ import IntegerSetting from '../helpers/integer_setting.vue'
|
||||||
import FloatSetting from '../helpers/float_setting.vue'
|
import FloatSetting from '../helpers/float_setting.vue'
|
||||||
import UnitSetting, { defaultHorizontalUnits } from '../helpers/unit_setting.vue'
|
import UnitSetting, { defaultHorizontalUnits } from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
|
import FontControl from 'src/components/font_control/font_control.vue'
|
||||||
|
|
||||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
|
import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
@ -36,12 +38,16 @@ const AppearanceTab = {
|
||||||
IntegerSetting,
|
IntegerSetting,
|
||||||
FloatSetting,
|
FloatSetting,
|
||||||
UnitSetting,
|
UnitSetting,
|
||||||
ProfileSettingIndicator
|
ProfileSettingIndicator,
|
||||||
|
FontControl
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
horizontalUnits () {
|
horizontalUnits () {
|
||||||
return defaultHorizontalUnits
|
return defaultHorizontalUnits
|
||||||
},
|
},
|
||||||
|
fontsOverride () {
|
||||||
|
return this.$store.getters.mergedConfig.fontsOverride
|
||||||
|
},
|
||||||
columns () {
|
columns () {
|
||||||
const mode = this.$store.getters.mergedConfig.thirdColumnMode
|
const mode = this.$store.getters.mergedConfig.thirdColumnMode
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,51 @@
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<h3>{{ $t('settings.style.interface_font_user_override') }}</h3>
|
||||||
|
<ul class="setting-list">
|
||||||
|
<li>
|
||||||
|
<FontControl
|
||||||
|
:model-value="fontsOverride.interface"
|
||||||
|
name="ui"
|
||||||
|
:label="$t('settings.style.fonts.components.interface')"
|
||||||
|
:fallback="{ family: 'sans-serif' }"
|
||||||
|
no-inherit="1"
|
||||||
|
@update:modelValue="v => $store.dispatch('setOption', { name: 'fontsOverride', value: { ...fontsOverride, interface: v } })"
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<FontControl
|
||||||
|
v-if="expertLevel > 0"
|
||||||
|
:model-value="fontsOverride.input"
|
||||||
|
name="input"
|
||||||
|
:fallback="{ family: 'inherit' }"
|
||||||
|
:label="$t('settings.style.fonts.components.input')"
|
||||||
|
@update:modelValue="v => $store.dispatch('setOption', { name: 'fontsOverride', value: { ...fontsOverride, input: v } })"
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<FontControl
|
||||||
|
v-if="expertLevel > 0"
|
||||||
|
:model-value="fontsOverride.post"
|
||||||
|
name="post"
|
||||||
|
:fallback="{ family: 'inherit' }"
|
||||||
|
:label="$t('settings.style.fonts.components.post')"
|
||||||
|
@update:modelValue="v => $store.dispatch('setOption', { name: 'fontsOverride', value: { ...fontsOverride, post: v } })"
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<FontControl
|
||||||
|
v-if="expertLevel > 0"
|
||||||
|
:model-value="fontsOverride.postCode"
|
||||||
|
name="postCode"
|
||||||
|
:fallback="{ family: 'monospace' }"
|
||||||
|
:label="$t('settings.style.fonts.components.postCode')"
|
||||||
|
@update:modelValue="v => $store.dispatch('setOption', { name: 'fontsOverride', value: { ...fontsOverride, postCode: v } })"
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<UnitSetting
|
<UnitSetting
|
||||||
path="emojiSize"
|
path="emojiSize"
|
||||||
|
|
|
@ -765,6 +765,7 @@
|
||||||
"select": "Select font"
|
"select": "Select font"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"interface_font_user_override": "Override theme/browser font used",
|
||||||
"switcher": {
|
"switcher": {
|
||||||
"keep_color": "Keep colors",
|
"keep_color": "Keep colors",
|
||||||
"keep_shadows": "Keep shadows",
|
"keep_shadows": "Keep shadows",
|
||||||
|
|
|
@ -121,6 +121,7 @@ export const defaultState = {
|
||||||
navbarSize: undefined, // instance default
|
navbarSize: undefined, // instance default
|
||||||
panelHeaderSize: undefined, // instance default
|
panelHeaderSize: undefined, // instance default
|
||||||
forcedRoundness: undefined, // instance default
|
forcedRoundness: undefined, // instance default
|
||||||
|
fontsOverride: undefined, // instance default
|
||||||
navbarColumnStretch: false,
|
navbarColumnStretch: false,
|
||||||
greentext: undefined, // instance default
|
greentext: undefined, // instance default
|
||||||
useAtIcon: undefined, // instance default
|
useAtIcon: undefined, // instance default
|
||||||
|
@ -184,6 +185,7 @@ const config = {
|
||||||
applyConfig(state)
|
applyConfig(state)
|
||||||
},
|
},
|
||||||
setOption (state, { name, value }) {
|
setOption (state, { name, value }) {
|
||||||
|
console.log('SET OPTION', state, name, value)
|
||||||
set(state, name, value)
|
set(state, name, value)
|
||||||
},
|
},
|
||||||
setHighlight (state, { user, color, type }) {
|
setHighlight (state, { user, color, type }) {
|
||||||
|
|
|
@ -104,6 +104,7 @@ const defaultState = {
|
||||||
navbarSize: '3.5rem',
|
navbarSize: '3.5rem',
|
||||||
panelHeaderSize: '3.2rem',
|
panelHeaderSize: '3.2rem',
|
||||||
forcedRoundness: -1,
|
forcedRoundness: -1,
|
||||||
|
fontsOverride: {},
|
||||||
virtualScrolling: true,
|
virtualScrolling: true,
|
||||||
sensitiveByDefault: false,
|
sensitiveByDefault: false,
|
||||||
conversationDisplay: 'linear',
|
conversationDisplay: 'linear',
|
||||||
|
|
Loading…
Reference in a new issue