forked from Blendman974/faceclaw
Merge shared tilt-down hide and angle measurement
# Conflicts: # app/g2/dashboard-controller.ts # app/g2/ios-preview-controller.ts
This commit is contained in:
23 files changed
+370
-26
No files matched your search
@@ -607,6 +607,11 @@ export const headUpWakeSetting = new HeadUpWakeSetting({
|
||||
description: "Enable waking the glasses when you look up. Until changed, the glasses keep their current setting. Glanceboard's Show on head tilt chooses what appears after waking.",
|
||||
});
|
||||
|
||||
export const headDownHideSetting = new ConfigSettingBoolean({
|
||||
id: "head-down-hide", label: "Tilt down to hide", storageKey: "display.headDownHide", defaultValue: false,
|
||||
description: "Lowering your head hides the display, including Glanceboard. A board shown by head tilt stays until you lower your head, with a 60-second safety timeout. Requires firmware forwarding HEAD_DOWN (Faceclaw/38).",
|
||||
});
|
||||
|
||||
export function normalizeHeadUpAngle(value: string | null | undefined): string {
|
||||
if (value == null || value.trim() === "" || !Number.isFinite(Number(value))) return "30";
|
||||
return String(Math.max(0, Math.min(60, Math.round(Number(value)))));
|
||||
@@ -617,7 +622,7 @@ export const headUpAngleSetting = new ConfigSettingEnum({
|
||||
values: Array.from({ length: 61 }, (_, angle) => String(angle)),
|
||||
normalize: normalizeHeadUpAngle,
|
||||
formatValue: angle => `${angle}°`,
|
||||
description: "Look-up trigger angle, 0–60 degrees. Until changed, the glasses keep their current angle. Requires validation on your Faceclaw firmware.",
|
||||
description: "Firmware head-up angle, 0–60 degrees, added to the glasses’ stored calibration. Until changed, the glasses keep their current angle. Requires validation on your Faceclaw firmware.",
|
||||
});
|
||||
|
||||
/** -1 means leave that firmware field unchanged; no writes on an untouched installation. */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { setAngleFromCurrentHead } from "../../g2/head-angle";
|
||||
import { remoteInputMenuItem } from "./remote-input-menu";
|
||||
import { knownFolders } from "@nativescript/core";
|
||||
import { getDefaultSmallFont } from "../../graphics/ui-fonts";
|
||||
@@ -51,6 +52,7 @@ import {
|
||||
brightnessSetting,
|
||||
headUpWakeSetting,
|
||||
headUpAngleSetting,
|
||||
headDownHideSetting,
|
||||
autoBrightnessMinSetting,
|
||||
autoBrightnessMaxSetting,
|
||||
autoBrightnessCurveSetting,
|
||||
@@ -122,7 +124,16 @@ function settingsSections(): SettingsSection[] {
|
||||
// the dashboard controller when changed and on each connect.
|
||||
enumSettingMenuItem(brightnessSetting),
|
||||
autoBrightnessMenuItem(),
|
||||
...(!global.isIOS ? [toggleSettingMenuItem(headUpWakeSetting), enumSettingMenuItem(headUpAngleSetting)] : []),
|
||||
...(!global.isIOS ? [toggleSettingMenuItem(headUpWakeSetting), enumSettingMenuItem(headUpAngleSetting), {
|
||||
label: "Set to current head angle",
|
||||
description: "Experimental estimate inspired by PR #64. Keep still, without tilting sideways, at a moderate head-up angle (under 45°). Adjust manually if needed.",
|
||||
onSelect: async (ctx: LayerContext) => {
|
||||
shell.showAlert("Measuring head angle — keep still");
|
||||
const result = await setAngleFromCurrentHead();
|
||||
shell.showAlert(result);
|
||||
ctx.actions.requestRender();
|
||||
},
|
||||
}, toggleSettingMenuItem(headDownHideSetting)] : []),
|
||||
enumSettingMenuItem(screenTimeoutSetting, {
|
||||
onChange: () => {
|
||||
shell.noteUserActivity();
|
||||
|
||||
Reference in new issue
Block a user