mirror of
https://git.undefined-dev.fr/Blendman974/faceclaw.git
synced 2026-11-29 13:03:11 +00:00
Add Glanceboard depth setting
This commit is contained in:
1 parent
71c1971992
commit
915f155819
29 files changed
+262
-50
No files matched your search
@@ -103,6 +103,31 @@ export const glanceShowOnHeadTiltSetting = new ConfigSettingBoolean({
|
||||
description: "Tilting your head up while asleep shows the Glanceboard instead of waking the regular UI.",
|
||||
});
|
||||
|
||||
const DEPTH_VALUES = ["-64", "-48", "-32", "-16", "0", "16", "32", "48", "64"] as const;
|
||||
export type GlanceDepth = (typeof DEPTH_VALUES)[number];
|
||||
|
||||
/**
|
||||
* Stereo depth of the board, in the firmware's depth units: the lenses shift
|
||||
* it by half this many pixels each, in opposite directions.
|
||||
*/
|
||||
export const glanceDepthSetting = new ConfigSettingEnum<GlanceDepth>({
|
||||
id: "glanceboard-depth",
|
||||
label: "Depth",
|
||||
storageKey: "glanceboard.depth",
|
||||
defaultValue: "0",
|
||||
values: DEPTH_VALUES,
|
||||
formatValue: (value) => {
|
||||
const depth = Number(value);
|
||||
return depth === 0 ? "0" : depth > 0 ? `+${depth} (nearer)` : `${depth} (farther)`;
|
||||
},
|
||||
description:
|
||||
"Moves the Glanceboard nearer (positive) or farther away (negative) by shifting it in opposite directions on the two lenses.",
|
||||
});
|
||||
|
||||
export function glanceDepth(): number {
|
||||
return Number(glanceDepthSetting.get());
|
||||
}
|
||||
|
||||
/** Hairlines between the board's slots. */
|
||||
export const glanceShowLinesSetting = new ConfigSettingBoolean({
|
||||
id: "glanceboard-show-lines",
|
||||
|
||||
Reference in new issue
Block a user