mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 16:17:20 +02:00
Support suggesting boolean settings
This commit is contained in:
parent
53d67616c3
commit
29f6413306
@ -140,6 +140,10 @@ export class SettingElement {
|
|||||||
!(e as any).ignoreOnChange && onChange(e, (e.target as HTMLInputElement).checked);
|
!(e as any).ignoreOnChange && onChange(e, (e.target as HTMLInputElement).checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
($control as any).setValue = (value: boolean) => {
|
||||||
|
$control.checked = !!value;
|
||||||
|
};
|
||||||
|
|
||||||
return $control;
|
return $control;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ import type { PrefKey } from "@/enums/pref-keys";
|
|||||||
import type { NumberStepperParams, SettingDefinitions } from "@/types/setting-definition";
|
import type { NumberStepperParams, SettingDefinitions } from "@/types/setting-definition";
|
||||||
import { BxEvent } from "../bx-event";
|
import { BxEvent } from "../bx-event";
|
||||||
import { SettingElementType } from "../setting-element";
|
import { SettingElementType } from "../setting-element";
|
||||||
|
import { t } from "../translation";
|
||||||
|
|
||||||
export class BaseSettingsStore {
|
export class BaseSettingsStore {
|
||||||
private storage: Storage;
|
private storage: Storage;
|
||||||
@ -145,6 +146,8 @@ export class BaseSettingsStore {
|
|||||||
if (value in options) {
|
if (value in options) {
|
||||||
return options[value];
|
return options[value];
|
||||||
}
|
}
|
||||||
|
} else if (typeof value === 'boolean') {
|
||||||
|
return value ? t('on') : t('off')
|
||||||
}
|
}
|
||||||
|
|
||||||
return value.toString();
|
return value.toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user