Skip to content

Commit

Permalink
Use a seperate setting name on android
Browse files Browse the repository at this point in the history
  • Loading branch information
MarmadileManteater committed Jan 12, 2025
1 parent 5731b25 commit b0a0459
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
14 changes: 12 additions & 2 deletions src/renderer/components/ThemeSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,23 @@ function updateHideHeaderLogo(value) {
}
/** @type {import('vue').ComputedRef<number>} */
const uiScale = computed(() => store.getters.getUiScale)
const uiScale = computed(() => {
if (process.env.IS_ANDROID) {
return store.getters.getUiScaleAndroid
} else {
return store.getters.getUiScale
}
})
/**
* @param {number} value
*/
function updateUiScale(value) {
store.dispatch('updateUiScale', value)
if (process.env.IS_ANDROID) {
store.dispatch('updateUiScaleAndroid', value)
} else {
store.dispatch('updateUiScale', value)
}
}
const useUiScale = computed(() => store.getters.getUseUiScale)
Expand Down
11 changes: 7 additions & 4 deletions src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ const state = {
defaultInvidiousInstance: '',
defaultVolume: 1,
uiScale: 100,
uiScaleAndroid: 100,
useUiScale: false
}

Expand Down Expand Up @@ -402,10 +403,12 @@ const sideEffectHandlers = {
if (process.env.IS_ELECTRON) {
const { webFrame } = require('electron')
webFrame.setZoomFactor(value / 100)
} else if (process.env.IS_ANDROID) {
if (state.useUiScale) {
android.setScale(value)
}
}
},

uiScaleAndroid: (_, value) => {
if (state.useUiScale) {
android.setScale(value)
}
},

Expand Down

0 comments on commit b0a0459

Please sign in to comment.