refactor: link fontsize & position sliders directly to client settings

This commit is contained in:
Sean McBroom 2024-07-09 01:31:19 -05:00 committed by Fernando Fernández
parent d7db912380
commit 84dcbe2260

View File

@ -10,20 +10,18 @@
:items="availableSubtitleFonts"/>
<VSlider
v-model="fontSize"
v-model="clientSettings.subtitleAppearance.fontSize"
:label="$t('fontSize')"
:min="1"
:max="4.5"
:step="0.1"
@end="updateFontSize"/>
:step="0.1"/>
<VSlider
v-model="positionFromBottom"
v-model="clientSettings.subtitleAppearance.positionFromBottom"
:label="$t('positionFromBottom')"
:min="0"
:max="30"
:step="1"
@end="updatePositionFromBottom"/>
:step="1"/>
<VCheckbox
v-model="clientSettings.subtitleAppearance.backdrop"
@ -53,18 +51,6 @@ route.meta.title = t('subtitles');
const availableSubtitleFonts = ref<string[]>([]);
// Temporary values for slider preview
const fontSize = ref(clientSettings.subtitleAppearance.fontSize);
const positionFromBottom = ref(clientSettings.subtitleAppearance.positionFromBottom);
// Functions to update settings on slider release
const updateFontSize = () => {
clientSettings.subtitleAppearance.fontSize = fontSize.value;
};
const updatePositionFromBottom = () => {
clientSettings.subtitleAppearance.positionFromBottom = positionFromBottom.value;
};
// Load subtitle fonts available to the client
const loadAvailableFonts = async () => {
const checkFontAvailability = async (font: string) => {