add minEnabledHeight to settings

This commit is contained in:
Tamius Han 2024-12-28 01:42:13 +01:00
parent 002dfacc3e
commit ed2886d449
5 changed files with 8 additions and 3 deletions

View File

@ -219,6 +219,7 @@ interface SettingsInterface {
enabledFullscreenOnly: boolean, enabledFullscreenOnly: boolean,
popupAlignment: 'left' | 'right', popupAlignment: 'left' | 'right',
minEnabledWidth: number, // don't show UI if player is narrower than % of screen width minEnabledWidth: number, // don't show UI if player is narrower than % of screen width
minEnabledHeight: number, // don't show UI if player is narrower than % of screen height
activation: 'trigger-zone' | 'player', // what needs to be hovered in order for UI to be visible activation: 'trigger-zone' | 'player', // what needs to be hovered in order for UI to be visible
triggerZoneDimensions: { // how large the trigger zone is (relative to player size) triggerZoneDimensions: { // how large the trigger zone is (relative to player size)
width: number width: number

View File

@ -104,6 +104,10 @@ export default {
return this.settings?.getSiteSettings(this.site) ?? null; return this.settings?.getSiteSettings(this.site) ?? null;
} }
return null; return null;
},
resetSettings() {
this.settings.active = JSON.parse(JSON.stringify(this.settings.default));
this.settings.saveWithoutReload();
} }
}, },
methods: { methods: {

View File

@ -184,7 +184,7 @@ export default {
methods: { methods: {
optionalToFixed(v, n) { optionalToFixed(v, n) {
if ((`${v}`.split('.')[1]?.length ?? 0) > n) { if ((`${v}`.split('.')[1]?.length ?? 0) > n) {
return v.toFixed(2); return v.toFixed(n);
} }
return v; return v;
}, },
@ -292,8 +292,6 @@ export default {
this.settings.active.ui.inPlayer.triggerZoneDimensions.offsetY = cy; this.settings.active.ui.inPlayer.triggerZoneDimensions.offsetY = cy;
}, },
//#region slider window //#region slider window
forceNumber(value) { forceNumber(value) {
// Change EU format to US if needed // Change EU format to US if needed

View File

@ -172,6 +172,7 @@ const ExtensionConfPatch = [
enabled: true, // enable by default on new installs enabled: true, // enable by default on new installs
enabledFullscreenOnly: false, enabledFullscreenOnly: false,
minEnabledWidth: 0.75, minEnabledWidth: 0.75,
minEnabledHeight: 0.75,
activation: 'player', activation: 'player',
popupAlignment: 'left', popupAlignment: 'left',
triggerZoneDimensions: { triggerZoneDimensions: {

View File

@ -163,6 +163,7 @@ const ExtensionConf: SettingsInterface = {
enabled: true, // enable by default on new installs enabled: true, // enable by default on new installs
enabledFullscreenOnly: false, enabledFullscreenOnly: false,
minEnabledWidth: 0.75, minEnabledWidth: 0.75,
minEnabledHeight: 0.75,
activation: 'player', activation: 'player',
popupAlignment: 'left', popupAlignment: 'left',
triggerZoneDimensions: { triggerZoneDimensions: {